C-Loop Question and Answer

C-Loop Question and Answer
41. Find the output
void main ( )
{
int i;
while (i=strrcmp ("cite", "cite\0"));
}

  • 0
  • 1
  • 11111....
  • None of these
Show Answer
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
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
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
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
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
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
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
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
50. Infinite loop can be used for

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