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 12



Share with a Friend

Multiple Choice Questions


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

56. What is the Priority of C Logical Operators ? NOT (!), AND (&&) and OR (||)
A). NOT (!) > AND (&&) > OR (||)
B). NOT (!) > AND (&&) = OR (||)
C). AND (&&) > OR (||) > NOT (!)
D). AND (&&) = OR (||) > NOT (!)
View Answer
Correct: A




57. Consider the following code fragment
for(digit = 0; digit < 9; digit++)
{
        digit = 2*digit;
        digit - -;
}
How many times the loop will be executed?

A). Infinite
B). 9
C). 5
D). 0
View Answer
Correct: A




58. What is the output of C Program ?
int main()
{
    int a=9, b;
    
    b = (a==9) ? (printf("CAT\n");printf("DOG\n")) : (printf("FOX"));

    return 0;
}
A). CAT DOG
B). FOX
C). CAT DOG FOX
D). Compiler error
View Answer
Correct: D




59. The output of the following code segment will be
char x = 'B';
switch (x) 
{
        case 'A' : printf ("a");
        case 'B' : printf ("b");
        default  : printf ("c");
}
A). B
B). a
C). C
D). b
View Answer
Correct: D




60. What is the output of C Program ?
int main()
{
    int a=9, b=6;
    if(a==9 && b==6)
    {
        printf("Hockey");
    }
    else
    {
        printf("Cricket");
    }
        printf(" Football");
    return 0;
}
A). Cricket Football
B). Hockey Football
C). Football
D). Compiler error
View Answer
Correct: B