Question 1
for (i < 10; i = 0 ; i++) // (i)<br>
for (i < 10; i++ ; i = 0) // (ii)<br>
for (i = 0; i < 10 ; i++) // (iii)<br>
for (i = 0; i++ ; i < 10) // (iv)<br>
for (i++; i = 0 ; i < 10) // (v)<br>
for (i++; i < 0 ; i = 10) // (vi)<br>
Question 2
for (i = 0; i < 10 ; i++) // (i)<br>
for ( ; i < 10 ; i++) // (ii)<br>
for (i = 0; ; i++) // (iii)<br>
for (i = 0; i < 10 ; ) // (iv)<br>
for ( ; ; ) // (v)<br>
Question 3
What’s going to happen when we compile and run the following C program?
#include < stdio.h >
int main()
{
int i = 1, j;
for ( ; ; )
{
if (i)
j = --i;
if (j < 10)
printf("GeeksQuiz", j++);
else
break;
}
return 0;
}
Compile Error.
No compile error but it will run into infinite loop printing GeeksQuiz.
No compile error and it’ll print GeeksQuiz 10 times.
No compile error but it’ll print GeeksQuiz 9 times.
Question 4
What’s going to happen when we compile and run the following C program?
#include < stdio.h >
int main()
{
int j = 0;
for ( ; j < 10 ; )
{
if (j < 10)
printf("Geeks", j++);
else
continue;
printf(“Quiz”);
}
return 0;
}
Compile Error due to use of continue in for loop.
No compile error but it will run into infinite loop printing Geeks.
No compile error and it’ll print GeeksQuiz 10 times followed by Quiz once.
No compile error and it’ll print GeeksQuiz 10 times.
Question 5
Which of the following statement is correct for switch controlling expression?
There are 5 questions to complete.