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 3



Share with a Friend

Multiple Choice Questions


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

11. How many times following loop will be executed?
void main()
{
   int i = 32766;
   while (i<= 32767)
     {
        printf("%d\n",i);
        i = i + 1;
      }
 }
A). 2 times
B). 1 times
C). infinite times
D). loop will not be executed
View Answer
Correct: A




12. What is the output of the C Program ?
int main()
{
    int a=0;
    a = 5>2 ? printf("4"): 3;
    printf("%d",a);

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




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




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

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




15. Which among the following is a unconditional control structure.
A). goto
B). for
C). do-while
D). if-else
View Answer
Correct: A