Top

Control Instructions

1.

The keyword ‘break’ cannot be simply used within:

Answer: B

No answer description available for this question.

Enter details here

2.

#include 
 
int main()
{
    unsigned int i = 65000;
    while (i++ != 0);
    printf("%d", i);
    return 0;
}

 

Answer: C

No answer description available for this question.
 

Enter details here

3.

The output of the code below is

#include 
    void main()
    {
        char *ch;
        printf("enter a value btw 1 to 3:");
        scanf("%s", ch);
        switch (ch)
        {
        case "1":
            printf("1");
            break;
        case "2":
            printf("2");
            break;
        }
    }

 

Answer: C

No answer description available for this question.
 

Enter details here

4.

Which loop is guaranteed to execute at least one time.

Answer: C

No answer description available for this question.
 

Enter details here

5.

Which of the following statements are correct about an if-else statements in a C-program?

1. Every if-else statement can be replaced by an equivalent statements using   ?: operators

2. Nested if-else statements are allowed.

3. Multiple statements in an if block are allowed.

4. Multiple statements in an else block are allowed.

Answer: D

No answer description available for this question.
 

Enter details here

6.

Which of the following is correct with respect to “Jump Statements” in C?

Answer: D

No answer description available for this question.
 

Enter details here

7.

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

1. switch is useful when we wish to check the value of variable against a particular set of values.

2. switch is useful when we wish to check whether a value falls in different ranges.

3. Compiler implements a jump table for cases used in switch.

4. It is not necessary to use a break in every switch statement.

Answer: B

No answer description available for this question.
 

Enter details here

8.

Consider the following pseudocode:

x:=1;
i:=1;
while (x ≤ 500)
begin
x:=2x ;
i:=i+1;
end

What is the value of i at the end of the pseudocode?

Answer: B

No answer description available for this question.
 

Enter details here

Answer: B

No answer description available for this question.
 

Enter details here

10.

What will be the output of the program?

#include
int main()
{
    int i = 5;
    while(i-- >= 0)
        printf("%d,", i);
    i = 5;
    printf("\n");
    while(i-- >= 0)
        printf("%i,", i);
    while(i-- >= 0)
        printf("%d,", i);
    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