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 1



Share with a Friend

Multiple Choice Questions


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

1. What is the output?
void main()
{ 
  int num=10; 
  if(num)
     printf("If Executed"); 
  else 
     printf("Else Executed");
}  
A). If Executed
B). Else Executed
C). Error
D). Blank
View Answer
Correct: A




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




3. What is the output?
void main()
{ 
  if(1 || 0) 
    printf("C Programming"); 
  else 
    printf("learn C"); 
} 
A). learn C
B). Compile Error
C). C Programming
D). Error
View Answer
Correct: C




4. What is the other name for C Language ?: Question Mark Colon Operator ?
A). Comparison Operator
B). If-Else Operator
C). Binary Operator
D). Ternary Operator
View Answer
Correct: D




5. What is the output?
void main()
{
  int x = 5;
  if (x < 1)
    printf("hello");
    if (x == 5)
       printf("hi");
    else
       printf("no");
}
A). hi
B). hello
C). no
D). error
View Answer
Correct: A