Top

Control Instructions

41.

Comment on the following code below

#include 
    void main()
    {
        int x = 5;
        if (true);
            printf("hello");
    }

 

Answer: B

No answer description available for this question.
 

Enter details here

42.

Consider the following program fragment i=6720; j=4; while (i%j)==0 { i=i/j; j=j+1; } On termination j will have the value

Answer: C

No answer description available for this question.
 

Enter details here

44.

Which of the following statements are correct about the below program?

#include
int main()
{
    int i = 10, j = 15;
    if(i % 2 = j % 3)
        printf("IndiaBIX\n");
    return 0;
}

 

Answer: B

No answer description available for this question.
 

Enter details here

45.

How many times GeeksQuiz is printed

#include
int main()
{
    int i = -5;
    while (i <= 5)
    {
        if (i >= 0)
            break;
        else
        {
            i++;
            continue;
        }
        printf("GeeksQuiz");
    }
    return 0;
}

 

Answer: D

No answer description available for this question.
 

Enter details here

46.

What will be the output of the program?

#include
int main()
{
    int i = 1;
    switch(i)
    {
        printf("Hello\n");
        case 1:
            printf("Hi\n");
            break;
        case 2:
            printf("\nBye\n");
            break;
    }
    return 0;
}

 

Answer: C

No answer description available for this question.
 

Enter details here

47.

When 1 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, ch + 1)
        {
        case 1:
            printf("1\n");
            break;
        case 2:
            printf("2");
            break;
        }
    }

 

Answer: B

No answer description available for this question.
 

Enter details here

48.

Which of the following statements are correct about the below program?

#include
int main()
{
    int i = 0;
    i++;
    if(i <= 5)
    {
        printf("IndiaBIX\n");
        exit(0);
        main();
    }
    return 0;
}

 

Answer: B

No answer description available for this question.
 

Enter details here

49.

Can we use a switch statement to switch on strings?

Answer: B

No answer description available for this question.
 

Enter details here

50.

How many lines of output does the following C code produce?

#include
float i=2.0;
float j=1.0;
float sum = 0.0;
main()
{
    while (i/j > 0.001)
    {
        j+=j;
        sum=sum+(i/j);
        printf("%fn", sum);
    }
}

 

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