C Programming Multiple Choice Questions (MCQ) | IT Developer <?php echo $page_title; ?>
IT Developer

C Programming Multiple Choice Questions (MCQ)

C Programming - Conditional Statements & Loops Multiple Choice Questions (MCQ) - Set 9



Share with a Friend

Multiple Choice Questions


C Programming - Conditional Statements & Loops Multiple Choice Questions (MCQ) - Set 9

41. What is the way to suddenly come out of or Quit any Loop in C Language?
A). continue;
B). break;
C). stop;
D). quit;
View Answer
Correct: B




42. What is the output of C Program ?
int main()
{
    int x=1;
    float y = 1.0;
    if(x == y)
    {
        printf("Hockey\n");
    }
    if( 1 == 1.0)
    {
        printf("Golf\n");
    }

    if( 1.0 == 1.0f )
    {
         printf("Boxing\n");
    }
    return 0;
}
A). No Output
B). Boxing
C). Golf Boxing
D). Hockey Golf Boxing
View Answer
Correct: D




43. Assume that i,j and k are integer variables and their values are 8, 5 and 0 respectively. What will be the values of variables i and k after executing the following expression?
 k = (j > 5) ? (i < 5) ? i-j : j-i : k-j;
 i-= (k) ? (i) ? (j) ? : (i) : (k);
What will be the result of execution?

A). 3 and 3
B). and -5
C). and -3
D). 5 and 3
View Answer
Correct: B




44. What is the output of C Program ?
int main()
{
    int a=9;
    if(a=8)
    {
        printf("Duck\n");
    }
    printf("Eggs\n");

    return 0;
}
A). No output
B). Eggs
C). Duck Eggs
D). Compiler error
View Answer
Correct: C




45. Data type of the controlling statement of a SWITCH statement cannot of the type:
A). int
B). char
C). short
D). float
View Answer
Correct: A