Top 150+ Solved Programming for Problem Solving MCQ Questions Answer
Q. How many times C.com is printed?int main(){int a = 0;while(a++ < 5)printf("C.com");return 0;}
a. 5 times
b. 4 times
c. 3 times
d. 1 times
Q. How many times C.com is printed?int main(){int a = 0;while(a++)printf("C.com");return 0;}
a. 1 time
b. 0 time
c. Infinite times(Untill Stack is overflow)
d. 2 times
Q. How many times C.com is printed?int main(){int a = 0;while(++a){ printf("C.com");}return 0;}
a. 1 time
b. Infinite Times(Untill Stack is overflow)
c. 2 times
d. Error
Q. What is output of below program?int main(){int i,j;for(i = 0,j=0;i<5;i++){ printf("%d%d--",i,j);}return 0;}
a. 0--01--12--23--34--
b. 00--10--20--30--40--
c. Compilation Error
d. 00--01--02--03--04--
Q. What is output of below program?int main(){int i;for(i=0; i<5; ++i++){ printf("Hello");}return 0;}
a. Hello is printed 5 times
b. Compilation Error
c. Hello is printed 2 times
d. Hello is printed 3 times
Q. What is output of below program?int main(){for(; ;);for(; ;); printf("Hello");return 0;}
a. Compilation Error
b. Runtime Error
c. Nothing is printed
d. Hello is printed infinite times
Q. What is the output of below program?int main(){for(; ;)for(; ;) printf("Hello..");return 0;}
a. Compilation Error
b. Runtime Error
c. Hello is printed one time
d. Hello is printed infinite times
Q. What is storage class for variable A in below code?int main(){int A;A = 10;printf("%d", A);return 0;}
a. extern
b. auto
c. register
d. static
Q. #include "stdio.h"int main(){int a@ = 10;printf("%d", a@);return 0;}
a. 10
b. 10@
c. @
d. [Error] stray '@' in program
Q. #include "stdio.h"int main(){int a = 10;printf("%d", a);int a = 20;printf("%d",a);return 0;}
a. 1020
b. Error: Redeclartion of a
c. 2020
d. 1010
Q. #include "stdio.h"int a = 20;int main(){int a = 10;printf("%d", ::a);return 0;}
a. 10
b. 20
c. ::20
d. ::10