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 15



Share with a Friend

Multiple Choice Questions


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

71. What is the output?
void main()
  {
     int ch;
     printf("enter a value between 1 to 2:");
     scanf("%d", &ch);
     switch (ch)
       {
          case 1:
            printf("1\n");

            printf("Hi");
          default:
            printf("2\n");
       }
   }
//2 is input
A). 1
B). Hi 2
C). 2
D). Error
View Answer
Correct: C



72. Choose a right C Statement.
A). Loops or Repetition block executes a group of statements repeatedly.
B). Loop is usually executed as long as a condition is met.
C). Loops usually take advantage of Loop Counter
D). All the above.
View Answer
Correct: D




73. Which are not looping structures?
A). for loop
B). while loop
C). do...while loop
D). if...else
View Answer
Correct: D




74. Loops in C Language are implemented using ?
A). While Block
B). For Block
C). Do While Block
D). All the above
View Answer
Correct: D




75. What is the output of the following code:
void main()
  {
    int i;
    for (i=1; i<=10; i++);
       printf("%d\n", i);
}
A). 10
B). 1 to 10
C). 11
D). None of the above
View Answer
Correct: C