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 4



Share with a Friend

Multiple Choice Questions


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

16. What is the output of C Program ?
int main()
{
    int a=0, b;
    a = (5>2) ? b=6: b=8;
    printf("%d %d",a, b);

    return 0;
}
A). 6 6
B). 0 6
C). 0 8
D). compiler error
View Answer
Correct: D




17. What is the output?
{
   int x = 0;
     if (x == 1)
         if (x >= 0)
             printf("true\n");
         else
             printf("false\n");
}
A). true
B). false
C). blank
D). Error
View Answer
Correct: C




18. Choose a correct statement regarding C Comparison Operators.
A). (x == y) Is x really equal to y. (x != y) Is x not equal to y.
B). (x < y) Is x less than y (x > y) Is x greater than y
C). (x <= y) Is x less than or equal to y. (x >= y) Is x greater than or equal to y
D). All the above
View Answer
Correct: D




19. Choose a C Conditional Operator from the list.
A). ?:
B). :?
C). :<
D). <:
View Answer
Correct: A




20. Choose a statement to use C If Else statement.
A). else if is compulsory to use with if statement.
B). else is compulsory to use with if statement.
C). else or else if is optional with if statement.
D). None of the above
View Answer
Correct: C