Top

Control Instructions

21.

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

Answer: B

No answer description available for this question.
 

Enter details here

23.

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

24.

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

25.

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

Answer: B

No answer description available for this question.
 

Enter details here

27.

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

28.

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

29.

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

30.

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

Loading…
Tags: Control Instructions Questions and Answers || Control Instructions MCQ Questions and Answers || Control Instructions GK Questions and Answers || Control Instructions GK MCQ Questions || Control Instructions Multiple Choice Questions and Answers || Control Instructions GK || GK on Control Instructions || C Programming Questions and Answers || C Programming MCQ Questions and Answers || C Programming GK Questions and Answers || GK on C Programming