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

21. When loop looses its stop value then it is called I. Odd loop II. Even loop III. Unknown loop IV. User friendly loop

  • only I
  • I & III
  • III & IV
  • II & IV
Show Answer Report

22. Which of the following loop is controlled by user ?

  • for loop
  • while loop
  • do-while loop
  • All of the above
Show Answer Report

23. Find the output void main ( ) { int i; for (i=1; i<=5; i++) { printf("%d", i); if (i==3) continue; i++; } }

  • 123
  • 12333.....
  • 134
  • 12345
Show Answer Report

24. Find the output. void main ( ) { char a[ ]={'\0', 'n', 'i', 'c', 'e'}; int i; for (i=0; i<sizeof(a); i++) printf ("%d", a[i]); }

  • nice
  • Prints nice with a space at the beginning
  • Compilation error
  • No output
Show Answer Report

25. Find the output void main ( ) [ char a[ ]={'\0', 'n', 'i', 'c', 'e'}; int ; for (i=0; i<sizeof (a); i++0 printf ("%c", a[i]); }

  • nice
  • Prints nice with a space at the beginning
  • Compilation error
  • No output
Show Answer Report

26. Find the output void main ( ) { int i=0; for ((; ++i<=5;) printf ('%d", i); }

  • 0 1 2 3 4 5
  • 1 2 3 4 5
  • Compilation error
  • Infinite loop
Show Answer Report

27. Find the output void main ( ) { int x=1; float y=3; do printf("%d', x++); while (x!=y); }

  • 1 2
  • 1 2 3
  • Compilation error
  • None of these
Show Answer Report

28. Find the output. void main ( ) { int x=5, y=6; do { x=x+y; y=x-y; x=x+y; } while (x<y); printf('%d %d", x, y); }

  • 6 5
  • 5 6
  • Infinite loop
  • None of these
Show Answer Report

29. Find the output void main ( ) { int x=15; while (x!0) { printf('%x", x); x=x/2; } }

  • 15731
  • 1111
  • f731
  • None of these
Show Answer Report

30. State the incorrect statement.

  • In a while loop the control conditional heck is performed n time.
  • In a do-while loop the control conditional check is performekd n+1 time.
  • break is a keyword used with if and switch case.
  • None of these
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test