Top 150+ Solved Programming for Problem Solving MCQ Questions Answer

From 46 to 60 of 105

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

  • b. 0 time

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

  • b. Infinite Times(Untill Stack is overflow)

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--

  • b. 00--10--20--30--40--

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

  • b. Compilation Error

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

  • c. Nothing is printed

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

  • d. Hello is printed infinite times

Q. How many loops are there in C

a. 1

b. 2

c. 3

d. 4

Q. What is the following is invalid header file in C?

a. math.h

b. mathio.h

c. string.h

d. ctype.h

  • b. mathio.h

Q. #include "stdio.h"int main(){int a@ = 10;printf("%d", a@);return 0;}

a. 10

b. 10@

c. @

d. [Error] stray '@' in program

  • 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

  • b. Error: Redeclartion of a
Subscribe Now

Get All Updates & News