Loop Questions and Answers

Take Exam

Loop Questions with Answers are among the most frequently asked topics in C programming aptitude and placement exams. These programming questions and answers test your understanding of iteration techniques such as for, while, and do-while loops. Practicing C loop MCQs with explanations helps you strengthen your logic-building skills and code efficiency. Commonly featured in Infosys, Accenture, and TCS placement papers, these loop-based problems prepare you for both theoretical and coding assessments. Access free C programming loop questions with answers PDF or take mock tests online for real exam experience.

Loop

Showing 10 of 98 questions

41. Find the output void main ( ) { int i; while (i=strrcmp ("cite", "cite\0")); }

  • 0
  • 1
  • 11111....
  • None of these
Show Answer Report

42. Find the output void main ( ) { int i; for (i=3; i<15; i+=3); printf("%d", i); }

  • 3 6 9 12
  • 3 3 3 3
  • 15
  • 12
Show Answer Report

43. In a for loop if the condition is missing then.

  • it is assumed to be present and taken to be true.
  • it is assumed to be present and taken to be false
  • It results in a syntax error
  • Execution will be terminated abrupty.
Show Answer Report

44. Find the output. void main ( ) { int i, j; for (i=3; i>=1;j--) for (j=i;j>=1' j--) printf ("%d", i); }

  • 321211
  • 333221
  • 332211
  • 123233
Show Answer Report

45. Find the output void main ( ) { int i=5. c=0; do { i--; c++; } whie (i==0); printf('%d', c); }

  • 3
  • 4
  • 1
  • None of these
Show Answer Report

46. Find the correct output. void main ( ) { while (99) { if (printf("%d", printf ('%d"))) break; else continue; } }

  • 0 1
  • 0 0
  • Infinite loop
  • None of these
Show Answer Report

47. How many times the loop will be executed ? void main ( ) { int i=0; for (;i++;) printf ("%d", i); }

  • Infinite times
  • 32767
  • 0
  • The maximum integer value for a particular machine
Show Answer Report

48. How many times a for loop will exeuted in this program ? void main ( ) { char ch; for (ch=0; ch<128; ch+4) printf('%d", ch); }

  • 127 times
  • 64 times
  • 32 times
  • Infinite times
Show Answer Report

49. Find the output void main ( ) int x=0; for (;;) { if (++x==6) break; continue; } printf('X=%d", x); }

  • X=5
  • X=6
  • X=7
  • Unpredictable output
Show Answer Report

50. Infinite loop can be used for

  • Time delay
  • Terminate execution
  • Software delay
  • Useless
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test