Top

Control Instructions

11.

Which of the following cannot be checked in a switch-case statement?

Answer: C

No answer description available for this question.
 

Enter details here

12.

How many times the while loop will get executed if a short int is 2 byte wide?

#include
int main()
{
    int j=1;
    while(j <= 255)
    {
        printf("%c %d\n", j, j);
        j++;
    }
    return 0;
}

 

Answer: B

No answer description available for this question.
 

Enter details here

13.

What is the output of this C code?

void main()

    {

        int k;

        for (k = -3; k < -5; k++)

            printf("Hello");

    }

 

Answer: D

No answer description available for this question.

Enter details here

14.

What is the output of the following C code?

#include 
int main()
{
int index;
for(index=1; index<=5; index++)
{
printf("%d", index);
if (index==3)
continue;
}
}

 

Answer: B

No answer description available for this question.
 

Enter details here

15.

A char variable can store either an ASCII character or a Unicode character.

Answer: A

No answer description available for this question.
 

Enter details here

16.

A short integer is at least 16 bits wide and a long integer is at least 32 bits wide.

Answer: A

No answer description available for this question.
 

Enter details here

17.

#include 
int i;
int main()
{
    if (i);
    else
        printf("Ëlse");
    return 0;
}

What is correct about the above program?

Answer: B

No answer description available for this question.
 

Enter details here

18.

Output?

#include 
int main()
{
    int c = 5, no = 10;
    do {
        no /= c;
    } while(c--);
  
    printf ("%dn", no);
    return 0;
}

 

Answer: B

No answer description available for this question.
 

Enter details here

19.

What is the output of the below program?

#include 
int main()
{
    int i = 0;
    switch (i)
    {
        case '0': printf("Geeks");
                break;
        case '1': printf("Quiz");
                break;
        default: printf("GeeksQuiz");
    }
    return 0;
} 

 

Answer: C

No answer description available for this question.
 

Enter details here

20.

When 2 is entered, The output of the code below is?

#include 
    void main()
    {
        int ch;
        printf("enter a value btw 1 to 2:");
        scanf("%d", &ch);
        switch (ch)
        {
        case 1:
            printf("1\n");
            break;
            printf("Hi");
        default:
            printf("2\n");
        }
    }

 

Answer: D

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