Top 50 C language MCQS :-
1. In the passage of text, individual words and punctuation marks
are known as
A) Constants
B) Keywords
C) Operators
D) Tokens
2. End of file is detected by
A) fend( )
B) endf( )
C) EOF
D) FEND
3. Which one of the following is not a keyword in C language?
A) main
B) endl
C) float
D) switch
4. The following code ‘for(;;)’ represents an infinite loop. It can be terminated by.
A) break
B) exit(0)
C) abort()
D) All of the mentioned
5. When we declare an array
A) Compiler
declare array name itself as a constant pointer to base address
B) A
continuous memory is allocated to store the elements value
C) Index of
elements is declared automatically
D) All elements are initialized to
zero
6. Which of the following is not a proper storage class in ‘C’?
A) auto
B) dec
C) static
D) extern
7. Which programming method is followed in C language?
A) Algorithm
B)
Flow-charts
C) Procedural
D) Object Oriented
8. What is the purpose of getc()?
A) read a
character from STDIN
B) read a
character from a file
C) read all
file
D) read file randomly
9. The keyword used to transfer control from a function back to the calling function is
A) switch
B) goto
C) go back
D) return
10. The do…while looping statement
A) is executed
only once if the condition is true.
B) is also
known as entry-controlled loop.
C) is executed
at least once if the condition is false.
D) is unconditional looping
statement..
11. Find the output of this program:
main()
{
int
o=1%2,p=sizeof(float);
int
q,r=5,s=10/2,t;
q=r>>2
&& p>31 - 12 % 4 ||r/q+3;
t=(p>q)?(s*r-2):(o/4%2);
printf("%d
%d",o,s);
}
A) Syntax error
due to unbalanced parenthesis.
B) Syntax error
due to value of q cannot be calculated.
C) 1 5
D) 0 5
1 |
D |
2 |
C |
3 |
B |
4 |
A |
5 |
B |
6 |
B |
7 |
C |
8 |
B |
9 |
D |
10 |
C |
11 |
C |
|
|
|
|
|
|
|
|
True / False C programming :-
11. for(i=0; i<5;i++); statement has syntax
error because of semicolon at the end.
22. Algorithm is the graphical representation of
logic.
33.
The default precision for
printing of floating point values is 6.
44.
If the floating-point number
is more precise than 6 digits, it will be rounded.
55.
A function call mechanism
that passes arguments to a function by passing a copy of the values of the arguments
is call by ref..
66. The string "Bilbo
Baggins", may be stored in an array of 13 characters.
77. malloc() allocates memory from the heap and not from the stack.
88. Array is not a Collection of similar type of data elements
99. Pictorial representation of an
algorithm is pseudecode.
110.
Diamond shape is used to show processing in a flowchart.
111.
Two pointer variables cannot be subtracted.
112.
The modulus
operator cannot be used with a long double.
113.
while(1) Unending loop if no break statement inside the body
114.
A pointer in C which has not been initialized is known as null
pointer.
115.
malloc( ) is used to allocate memory run time.
16. Goto is Used to bypass the remainder of the current pass through a loop
117.
5 += 5; evaluates to10.
118.
A pair of question mark and colon is known as unary operator .
119.
The argument
list of function is known as function’s parameters.
220.
ampersand symbol is used to indicate address of a variable.
221.
Typedef is a keyword used to assign alternative name to existing data type.
222.
Union ‘s concept borrowed from
array.
223.
int a[4]; Here 4 indicates size of an array and a[4]=3; here 4
represents 5th element.
224.
Function isdigit() is defined in conio.h header file.
25.
Function is
a names that are given to various program elements, such as variables.
226.
Linked list must require continuous memory allocation unlike array.
227.
static storage class is used to make a variable global.
228.
Array is primitive type of data type.
229.
Character constants are coded using double quotes.
330.
Pointers are used in a program to allocate memory before the program
execution.
331.
The conditional operator (?:) is a ternary operator.
332.
The size of long integer data type is 2.
333.
malloc() is a inbuilt library function to adjust the allocated
dynamic memory size.
334.
All static variables are automatically initialized to zero.
335.
A variable declared inside a function is called
local variable.
336.
ftell function is used to move the file position to desired location
within the file.
337.
The function strlen() computes the length of an argument string
excluding the null character.
38.
NULL
pointer is not same as an uninitialized pointer.
39. Every variable in c have three most fundamental attributes: Name, Value, Address.
40. In ‘C’, parameters to a function can be passed by value but not by reference.
1 |
F |
2 |
F |
3 |
T |
4 |
T |
5 |
F |
6 |
F |
7 |
T |
8 |
F |
9 |
F |
10 |
F |
11 |
F |
12 |
T |
13 |
T |
14 |
F |
15 |
T |
16 |
F |
17 |
F |
18 |
F |
19 |
T |
20 |
T |
21 |
T |
22 |
F |
23 |
T |
24 |
T |
25 |
F |
26 |
F |
27 |
F |
28 |
F |
29 |
F |
30 |
F |
31 |
T |
32 |
F |
33 |
F |
34 |
T |
35 |
T |
36 |
F |
37 |
T |
38 |
T |
39 |
T |
40 |
F |
0 Comments
Hey, What do you think about this post