Which of the following cannot be used as LHS of the expression in for (exp1;exp2; exp3) ?
Answer: D
No answer description available for this question.
Enter details here
Which of the following statement is correct for switch controlling expression?
Answer: B
No answer description available for this question.
Enter details here
The following code ‘for(;;)’ represents an infinite loop. It can be terminated by.
Answer: A
No answer description available for this question.
Enter details here
Which keyword is used to come out of a loop only for that iteration?
Answer: B
No answer description available for this question.
Enter details here
Point out the error, if any in the program.
#include
int main()
{
int i = 1;
switch(i)
{
case 1:
printf("Case1");
break;
case 1*2+4:
printf("Case2");
break;
}
return 0;
}
Answer: D
No answer description available for this question.
Enter details here
#include
int main()
{
int i;
for (i = 1; i != 10; i += 2)
printf(" GeeksQuiz ");
return 0;
}
Answer: B
No answer description available for this question.
Enter details here
What will be the output of the program?
#include
int main()
{
int i=4;
switch(i)
{
default:
printf("This is default\n");
case 1:
printf("This is case 1\n");
break;
case 2:
printf("This is case 2\n");
break;
case 3:
printf("This is case 3\n");
}
return 0;
}
Answer: A
No answer description available for this question.
Enter details here
What will be the output of the following C program segment?
char inchar = 'A';
switch (inchar)
{
case 'A' :
printf ("choice A n") ;
case 'B' :
printf ("choice B ") ;
case 'C' :
case 'D' :
case 'E' :
default:
printf ("No Choice") ;
}
Answer: C
No answer description available for this question.
Enter details here
Which for loop has range of similar indexes of 'i' used in for (i = 0;i < n>
Answer: D
No answer description available for this question.
Enter details here
Point out the error, if any in the while loop.
#include
int main()
{
int i=1;
while()
{
printf("%d\n", i++);
if(i>10)
break;
}
return 0;
}
Answer: A
No answer description available for this question.
Enter details here