Top

Control Instructions

71.

What will be the output of the program?

#include
int main()
{
    int x, y, z;
    x=y=z=1;
    z = ++x || ++y && ++z;
    printf("x=%d, y=%d, z=%d\n", x, y, z);
    return 0;
}

 

Answer: A

No answer description available for this question.
 

Enter details here

72.

What is the output of this C code?

int main()

    {

        int i = 0;

        for (foo(); i == 1; i = 2)

            printf("In for loop\n");

            printf("After loop\n");

    }

    int foo()

    {

        return 1;

    }

 

Answer: A

No answer description available for this question

Enter details here

73.

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

 

Answer: B

No answer description available for this question.
 

Enter details here

Answer: C

No answer description available for this question.
 

Enter details here

75.

What is the output of this C code?

void main()

    {

        int i = 0;

        int j = 0;

        for (i = 0;i < 5 xss=removed> 1)

                    continue;

                    printf("Hi \n");

            }

        }

    }

 

Answer: B

No answer description available for this question.

Enter details here

76.

Consider the following program fragment

if(a > b)
if(b > c)
s1;
else s2;

s2 will be executed if

Answer: D

No answer description available for this question.
 

Enter details here

77.

What will be the output of the program?

#include
int main()
{
    float a = 0.7;
    if(0.7 > a)
        printf("Hi\n");
    else
        printf("Hello\n");
    return 0;
}

 

Answer: A

No answer description available for this question.
 

Enter details here

78.

Which of the following is not logical operator?

Answer: A

No answer description available for this question.
 

Enter details here

79.

Which of the following sentences are correct about a for loop in a C program?

1. for loop works faster than a while loop.

2. All things that can be done using a for loop can also be done using a while loop

3. for(;;); implements an infinite loop.

4. for loop can be used if we want statements in a loop get executed at least once.

Answer: D

No answer description available for this question.
 

Enter details here

80.

What is the output of this C code?

void main()

    {

        int i = 0, j = 0;

        for (i = 0;i < 5 xss=removed> 1)

                    break;

            }

            printf("Hi \n");

        }

    }

 

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