30 very important C Language MCQs for test preparation
![C Language MCQS for Competitive Exams, FPSC, KPPSC, PPSC, SPSC, BPSC, Computer Programmer, Computer Operator, Assistant Programmer, Lecturer Computer Science, Software Engineer, IT Assistant, LDC, UDC, DEO.](https://sabaqasaan.com/wp-content/uploads/2022/11/c-language-cover-1.jpg)
21. What, will be output, of the following, “C” program?
#include int xyz=10; int main() {
int xyz=20; printf(“%d”, xyz); return 0;}
A) 10
B) 20
C) 30
D) Error
22. Following “program fragment”. main(){ printf(“%pn”, main() ); }
A) Is an error
B) In an infinite loop
C) Prints the address of main function
D) Prints 0
23. What, will be output, of the, following, program?
#include int main() (int a-2,
DE7, c=10; c=a==b; printf(“%«d.c); return 0;)
A) 34
B) 2
C) 0
D) 1
24. What is, the output, of, the following, “Program segment”?
main() { log i=65536;
printf(“9%dn”, i);)
A) 2232
B) 65536
C) 0
D) 76
25. What is the proper possible output of below mentioned program?
# include int main() {int
als]={5,1,15,20,25): int i, j, m; i=++allj
Jall]++; m=a[i++l: orintf(“%d, %d, %d
,j,m); return0;}
A) 1, 5, 1
B) 1, 12, 43
C) 3,6,8
D) 3, 2, 15
26. What, is the, output of, the, following, “program segment”?
main() { int=1; do {
printf(“6d.. “, i); } while (i-;}
A) 0
B)-1
C) O..1..
D) 1..0..
27. “Output” of the, program, below, is. int i;
Int main(void)
{ printf(“%d”, i); }
A)-1
B) Null
C) 1
D) O
28. What, will be the, “output of the following” program,?
main( )
{int i=5;
printf(“%d”, i=++i==6); }
A) 6
B) 1
C) O
D) 7
29. Which “symbol” is used, as a, ‘statement terminator’ in C?
A) #
B) ;
C) !
D) ~
30. If, the “size of the array” is less, than the, number of, initializes then,
A) Size of array is increased
B) Size is neglected when values are given
C) Extra values are being ignored
D) Generates an error message