GATE CSE C Programming Practice Test – Data Types & Operators | Set 1

Questions 56-60 of 100

Your score 0/100 0 answered
Correct 0 Incorrect 0 Unanswered 100 Accuracy 0%

Question 56

MCQ · Single Correct 1 mark

What happens in a C 'switch' statement if a matching 'case' is found but lacks a 'break' statement?

Answers for question 56

Question 57

MCQ · Single Correct 1 mark

What is the minimum number of times a 'do-while' loop body executes?

Answers for question 57

Question 58

MCQ · Single Correct 1 mark

What is the output of this code?

C
#include <stdio.h>
int sum = 0;
for (int i = 1; i <= 5; i++) {
    if (i % 2 == 0) continue;
    sum += i;
}
printf("%d", sum);
Answers for question 58

Question 59

MCQ · Single Correct 1 mark

Which of the following expression types is permitted inside a C 'switch(expr)' statement?

Answers for question 59

Question 60

MCQ · Single Correct 1 mark

What is the output of the code snippet?

C
#include <stdio.h>
int main(void) {
    int a = 1;
    switch(a) {
        case 1: printf("One ");
        case 2: printf("Two ");
        default: printf("Def");
    }
    return 0;
}
Answers for question 60
Scroll to Top