Free Practice / PYQ

GATE CSE C Programming Practice Test – Flow Control | Set 1

Questions 1-5 of 100

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

Question 1

MCQ · Single Correct 1 mark

What will be the output of the following C program?

C
#include <stdio.h>
int main(void) {
    int a = 5, b = 10, c = 15;
    if (a = b == c)
        printf("TRUE %d", a);
    else
        printf("FALSE %d", a);
    return 0;
}
Answers for question 1

💡 Right-click an option to strike it out

Question 2

MCQ · Single Correct 1 mark

What is the output of the following program?

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

💡 Right-click an option to strike it out

Question 3

MCQ · Single Correct 1 mark

Consider the code fragment below:

C
#include <stdio.h>
int main(void) {
    int i = 0;
    for (i = 1; i <= 10; i++) {
        if (i % 3 == 0)
            continue;
        if (i == 7)
            break;
        printf("%d ", i);
    }
    return 0;
}
Answers for question 3

💡 Right-click an option to strike it out

Question 4

MCQ · Single Correct 1 mark

How many times will the printf statement execute in the loop below?

C
#include <stdio.h>
int main(void) {
    int i = 1, n = 32;
    for (i = 1; i <= n; i = i * 2) {
        printf("C");
    }
    return 0;
}
Answers for question 4

💡 Right-click an option to strike it out

Question 5

MCQ · Single Correct 1 mark

What will be the output of the following C code?

C
#include <stdio.h>
int main(void) {
    int x = 10, y = 20;
    if (x > 5 == y > 15)
        printf("Equal");
    else
        printf("Not Equal");
    return 0;
}
Answers for question 5

💡 Right-click an option to strike it out

Scroll to Top