Professional Documents
Culture Documents
QUESTION BANK
S.NO Q&A CO K
LEVEL
PART- A
1 Who is the father of c language? CO1. K1
a. Steve Jobs 1
b. James Gosling
c. Dennis Ritchie
d. RasmusLerdorf
a.Auto
CO2.4 K1
b.Main
c.Case
d.Register
35 A C variable name can start with a ___ CO2.5 K1
a.Number
b.Plus Sign (+)
c. Underscore
d. Asterisk (*)
38 Which of the following header files is used for character type function in C
language?
a. <assert.h>
b. <ctype.h> CO2.4 K1
c. <iostream.h>
d. <locale.h>
39 Which of the following is the variable that can be used for all functions?
a. Static variable
b.Global variable
CO2.5 K2
c. Local variable
d. Dynamic variable
43 If statement is
a) Two-way decision making statement
b) Single way decision making statement
CO2.8 K1
c) No way decision making statement
d) None
D. Both A and C
49 What happens when you try to access an Array variable outside its size?
A) Compiler error is thrown
B) 0 value will be returned CO3.1 K1
C) 1 value will be returned
D) Some garbage value will be returned.
50 An array elements are always stored in ________ memory locations.
A. Random
b. User Defined
CO3.2 K2
c. 0
d. None of above
B. It is a declaratrion
D. All of these
55 Types of array are_____
C. long
a) a[ ][ ];
b) a[ ][ ]={2,4,5,3,8,1,7,8}; CO3.3 K2
c) a[3][4]={2,4,6,8,9,7,5,3,1};
d) a[3][4];
58 ____ maximum number of dimensions in an array.
A. 2
B. 8
CO3.4 K1
C. 16
D. Theoretically no limit. The only practical limits are memory size and
compilers
Printf or Scanffunction.?
A) %c
CO3.5 K2
B) %C
C) %s
D) %w
int main() {
char str[] = {'g', 'l', 'o', 'b', 'a', 'l'};
printf("%s", str);
return 0;
}
CO3.5 K3
a) 12
b) 0
c) 56
d) None of these
D. undefined function
int main()
char str[]={'g','l','o','b','e'};
printf("%s",str);
return 0; CO3.6 K2
}
A) g
B) globe
C) globe\0
A. strncon()
B. memcon() CO3.6 K2
C. strcpy()
D. strcat()
A) 32 characters
B) 64 characters
C) 256 characters
A. 1,2
B. 1,2,3
C. 2,4
D. 3,4
A. 0
B. 1 C03.7 k1
C. -1
Char str[]={'g','l','o','b','y'};
A) str[5] = 0;
B) str[5] = '\0'
CO3.7 K3
C) str[]={'g','l','o','b','y','\0'};
a) Declared
CO4.5 K1
b) Initialized
c) Both declared and initialized
d) None of these
80 In C a pointer variable to an integer can be created by the declaration
a) int p*;
b) int *p; CO4.5 K1
c) int +p;
d) int $p;
a) Passed to a function
b) Changed within a function
c) Returned by a function
d) Can be assigned an integer value
82 What is the output of the following C code?
char *ptr;
charmystring[] = "abcdefg";
ptr = myString;
ptr += 5; CO4.6 K3
a)Fg
b)efg
c)defg
d)cdefg
e)bcdefg
83 Will this program compile?
intmain() {
charstr[5] = "LetsFind";
return0;
CO4.6 K3
}
a)True
b)False
c) may be
d)Can’t say
84 The keyword used to transfer control from a function back to the calling
function is____
A. switch
CO4.4 K2
B. goto
C. return
D. exit
85 A pointer is a
a) Integer
b) Float CO4.4 K1
c) Array
d) Character
a)int
b) float
c) No datatype
d) Depends upon the type of the variable to which it is pointing
e) unsigned int
a) Self Function
b) Auto Function CO4.2 K1
c) Recursive Function
d) Static Function
a) Library Functions
b) User Defined Functions CO4.1 K1
c) Both Library and User Defined
d) None of the above
a) Pass By Value copies the variable value in one more memory location
b) Pass By Value does not use Pointers
CO4.3 K2
c) Pass By Value protects your source or original variables from changes
in outside functions or called functions
d) All the above
A. Call by value
B. call by reference CO4.3 K1
C. call by value result
D. None
A. I and II
B. I and III
C. II and III
D. II and IV
a) printf()
b) show() CO4.2 k1
c) scanf()
d) main()
a) 1
b) 2 CO4.2 K1
c) 3
d) 4
a)Alphabets, Numbers, %, $, _
CO4.1 K1
a) Definite arguments
b) Formal arguments
c) Actual arguments
d) Ideal arguments
A. It should be declared.
CO4.1 K1
B. It should be initialized
C. It should be both declared and initialized.
D. None of the above.
100 Forward declaration is absolutely necessary
A. (((***(a+i)+j)+k)+l)
B. ((**(*(a+i)+j)+k)+l)
CO4.6 K2
C. (*(*(*(a+i)+j)+k)+l)
D. *(*(*(*(a+i)+j)+k)+l)
103 In order to fetch the address of the variable we write preceding CO4.3 K2
_________ sign before variable name.
A. Percent(%)
B. Comma(,)
C. Ampersand(&)
D. Asteric(*)
A. It should be declared.
B. It should be initialized
CO4.6 K2
C. It should be both declared and initialized.
D. None of the above
char *ptr;
char myString[]="letsfind";
ptr=myString
CO4.6 K3
ptr+=5;
A. find
B. ind
C. letsf
D.f
107 Which of the following statements correct about k used in the below CO4.6 K2
statement?
char ****k;
108
Which of the following operators can be applied to CO5. K1
structure variables? 1
a. Equality comparison ( == )
b. Assignment ( = )
enumeration? 2
a. String
b. Structure
c. Char
2
a. struct
b. enum
c. typedef
name? 3
a. -
b. .
structure? 3
a. Another structure
b. Function
c. Array
an error? 3
a. struct temp{}s;
main(){}
b. struct temp{};
struct temp s;
main(){}
c. struct temp s;
struct temp{};
main(){}
115
What is the output of this C code? CO5. K2
void main()
struct student
{
int no;
char name[20];
};
struct student s;
s.no = 8;
printf("%d", s.no);
a. Nothing
c. Junk
below structure? 4
struct test
int k;
char c;
};
6
a. First member in the union
declaration? 6
union uTemp
double a;
int b[10];
char c;
}u;
= 1)
a. 4
b. 8
c. 40
d. 80
119
Members of a union are referred to as: CO5. K1
7
a. union-name.member
b. union-pointer->member
c. Both a & b
7
1.Union, 2. Structure, 3. Arrays and 4. Pointers
a. 3 and 4
b. 1 and 2
c. 1 and 3
d. 1, 3 and 4
121
Which of the following data types are accepted while CO5. K1
declaring bit-fields? 4
a. char
b. float
c. double
d. None of the mentioned
122
Which is not a storage class? CO5. K3
a. Auto
b. Struct
c. Typedef
d. Static
123
In the declaration of bit-fields, CO5. K2
struct-declarator: 7
declarator
b. Nothing
d. Error
124
In the event of a name conflict between a local and global CO5. K2
is defined first.
a. false
b. true
c. Nothing
d. Varies
126
Where will the space be allocated for an automatic storage CO5. K2
class variable? 8
a) In CPU register
c) In memory
d) On disk.
127
Which of the following statements about the usage of CO5. K2
structures is true? 7
a. Executable code
b. Source Code
c. Distributable Code
d. Macro code
129
What are the types of C pre-processor directives? CO5. K2
9
a. Macros
b. Conditional Compilation
c. File Inclusion
9 Write a pseudo code that reads two numbers and multiplies them CO1.7 K
together and print out their product. 3
10 Draft a pseudo code to print all multiples of 5 between 1 and 100 CO1.7 K
(including both 1 and 100). 3
11 Give the advantages and disadvantages of flow chart. CO1.8 K
2
12 Mention the steps involved in logical analysis and thinking CO1.6 K
methodology. 2
13 Describe the algorithmic approach to programming. CO1.6 K
2
14 Explain the control unit functions. CO1.2 K
2
15 Significance the function of CPU in the computer system. CO1.2 K
2
16 What are the steps involved problem solving in c program? CO2.1 K
2
17 Difference identifier and keywords in c. CO2.4 K
2
18 Define syntax in 'C'. CO2.2 K
2
19 Make brief notes about the main function() in the C program. CO2.3 K
2
20 What are the types of I/O statements available in ‘C’? CO2.7 K
2
21 What are the types of looping statements available in C CO2.8 K
2
22 Mention the various Decisions making statement available in C. CO2 K
.8 2
23 Distinguish between while and do-while statement in C. CO2.8 K
2
24 Define Compilation process. CO2.4 K
2
25 What do you meant by linking? CO2.4 K
2
26 Create a C program to check whether a number is prime or not CO2.9 K
3
27 Differentiate between formatted and unformatted you input and output functions? CO2.7 K
2
28 Briefly elaborate on the various control statement CO2.11 K
2
29 Describe the different types of operators used in C with the required program CO2.7 K
3
30 Show the different kinds of data in c CO2.6 K
2
31 Draw the structure of C program C02.3 K
2
32 Write the rules of C program. CO2.3 K
2
33 What are the data types used in C program? CO2.5 K
2
34 Draft a program to initialize array values as 10,20,30,40,50 CO3.1 K
2
35 Write a program to find average marks obtained by a class of 30 students in list. CO3.1 K
1
36 Point out the errors, if any, in the following program segments: CO3.2 K
# include <stdio.h> 3
int char mixed[ 100 ] ;
int main( )
{
int a[ 10 ], i ;
for ( i = 1 ; i<= 10 ; i++ )
{
scanf ( "%d", a[ i ] ) ;
printf ( "%d \ n", a[ i ] ) ;
}
return 0 ;
}
37 Difference between char array and string array. CO3.2 K
2
38 Describe the following with suitable examples. CO3.3 K
2
(i) Initializing a 2 Dimensional Array
int main( )
Inttwod[ ][ ]={
2,4,
6,8
};
Printf(“%d\n”,twod);
Return 0;
# include<string.h>
Int main()
{char*str1=”united”;
Char *str2=”front”;
Char*str3;
Str3=strcat(str1,str2);
Printf(“%s\n”,str3);
Return 0;
46 write a program that will read a line and delete from it all occurrences of the word CO3.6 K
'the' 3
47 Draft a program that converts a string like "124" to an integer 124 CO3.6 K
3
48 Write a program to pick up the largest number from any 5 row by 5 column CO3.9 K
matrix. 3
49 Describe pointers and the operations that can be performed on them. CO4.4 K
2
50 Explain the various categories of user defined functions in C with examples? CO4.1 K
2
51 Print out the errors, if any, in the following programs: CO4.3 K
2
#include<stdio.h>
Int main()
Inti=3,j=4,k,l;
k=addmult(i,j);
l=addmult(i,j);
printf(“%d%d\n”,k,l);
return 0;
}
Intaddmult( int ii, intjj)
Intkk,ll;
Kk=ii+jj;
Ll=ii*jj;
Return (kk,ll);
}
52 Write a C function using pointers to exchange the values stored in two CO4.4 K
locations in the memory 3
53 Write a program for pointer to void? CO4.1 K
3
54 Explain the use of the fflush() function. CO4.2 K
1
55 Distinguish between malloc() and calloc(). CO4.2 K
2
56 How many arguments can be used in a function? CO4.6 K
2
57 Write a recursive function to obtain the running sum of first 25 natural CO4.1 K
numbers. 3
58 Write a function that receives 5 integers and returns the sum, average and CO4.2 K
standard deviation of these numbers. Call this function from main( ) and print 3
the results in main( ).
59 Define pointers arithmetic. CO4.6 K
1
60 Differentiate actual parameters and formal parameters. CO4.5 K
3
61 Draft a program to find factorial of a number using recursion. CO4.4 K
3
62 Write a program to calculate GCD of two numbers using recursion CO4.3 K
3
63 Write a program to generate Fibonacci series using recursive functions. CO4.4
K
3
64
Compare structures and unions. CO5. K
5 2
65
Define structure in C. CO5. K
1 1
66
How to declare a structure member CO5. K
3 2
67
How to define a union in C CO5. K
5 2
68
How can you access the members of the union? CO5. K
6 2
69
What are the pre-processor directives? CO5. K
9 1
70
What are storage classes? CO5. K
8 1
71
What is the static storage class? CO5. K
8 2
72
What are conditional inclusions in the pre-processor CO5. K
directive? 9 2
73
Describe structure within structure function? CO5. K
4 1
74
Mention the need for structure data type C. CO5. K
2 1
PART –C
1 Convert the following binary numbers into decimal ,octal and CO1.5 K
hexadecimal numbers 3
(i)10111010101
(ii) 1011111101
(iii)10000111010101
(iv) 10000100101
2 Transform the followingnumbers system CO1.5 K
a) Decimalto binary 3
(i) 75
(ii) 1412
(iii)25.75
(iv)32
b)Decimal to octal
(i) 175.25
(ii) 1246
(iii) 46
(iv) 23
c)Decimal to hexadecimal
(i) 479
(ii) 510
(iii) 4584
(iv)352000
3 Draft the different blocks of flowchart and elaborate its functions. CO1.8 K
2
4 Explain in detail about generations and classification of computer. CO1.1 K
2
5 Distinguish between algorithm and pseudo code. CO1.7 K
2
6 Elaborate rules for correcting efficient algorithm. CO1.6 K
1
7 Describe the steps involved in binary number to octal and hexadecimal C01.5 K
number conversion system with an example. 3
14 A School with 600 students wants to produce some information from CO1.8 K
the results of the four standard tests in Maths, Science, English and IT. 6
Each test is out of 100 marks. The information should be the highest,
lowest and average mark for each test and the highest, lowest and
average mark overall. All the marks need to be input.
a.) Draw a flowchart for above mentioned task.
15 A School with 600 students wants to produce some information from CO1.6 K
the results of the four standard tests in Maths, Science, English and IT. 6
Each test is out of 100 marks. The information should be the highest,
lowest and average mark for each test and the highest, lowest and
average mark overall. All the marks need to be input.
a.) Draft an algorithm with reduce the number of students to 5 and the
number of subjects
to 2
16 Tickets are sold for a concert at $20 each. If 10 tickets are bought CO1.8 K
together,then the discount 10%. If 20 tickets are bought together, then 6
the discount is 20%. No more than 25 tickets can be bought in a single
transaction
(ii) strcpy()
(iii)strcat()
(iv)strcmp()
39 Explain about the string Input/ Output functions with example? CO3.4 K
3
40 Write a C program to find average marks obtained by a of 30 students in a test. CO3.4 K
3
41 Explain about the following : CO3.5 K
2
(i).String and character array.
Write a program that receives a 10-digit integer, computes the checksum, and
reports whether the ISBN number is correct or not
45 Develop a C program to search an element from the array. CO3.7 K
3
46 Elaborate binary search algorithm with an example program CO3.7 K
3
47 Draft a c program to multiply two matrices (two dimensional array). CO3.8 K
3
48 Write a C program to perform the following matrix operations: CO3.8 K
3
(i) Addition (ii) subtraction
49 Draft a program to swap numbers in cyclic order using Call by Reference CO4.3 K
3
50 Create a program in C to add numbers using call-by-reference. CO4.3 K
3
51 Find the maximum number between two numbers with a suitable C program CO4.8 K
code. 3
52 Develop a program in C to calculate the length of the string using a pointer. CO4.8 K
3
53 Write a program in C to find the square of any number using the function. CO4.8 K
3
54 Convert a decimal number to a binary number using the function in a suitable CO4.2 K
c program. 3
55 Check Armstrong and perfect numbers with the function and the appropriate CO4.8 K
C program code. 3
56 Explain recursion in detail with a C program. CO4.4 K
2
57 Illustrate the following CO4.3 K
(i) Call by value 2
(ii) Call by reference
58
Explain the structures within examples. C K
O 2
2
59
Write a C programme using structures to prepare the CO5. K
5 3
8
61
Describe in detail the pre-processors in C. C K
O 2
9
62
What are storage classes? Explain each with an example. C K
O 2
8
63
How can you insert structure into another structure? C K
O 2
6
64
Define Union. How can a structure be made to function in C? CO5. K
5 2
65
Create a database of employees with the following data: CO5. K
Empno 2 4
Name
Basic(pay)
Grade
Get the data and arrange the records on the basis of their
names.
1.opening account
2.deleting account
3.deposit
4.withdrawal
the day