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

Questions 91-95 of 100

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

Question 91

NAT · Numerical Answer 1 mark

What is the output of the following C program?

C
#include <stdio.h>
int main(void) {
    int a = 5, b = 2;
    printf("%d", a / b + a % b);
    return 0;
}
Answers for question 91

Question 92

NAT · Numerical Answer 1 mark

What is the value of 'x' after loop termination?

C
#include <stdio.h>
int main(void) {
    int x = 1;
    while (x < 20) {
        x *= 2;
    }
    printf("%d", x);
    return 0;
}
Answers for question 92

Question 93

NAT · Numerical Answer 1 mark

What is the output of 'printf("%d", 1 << 4);'?

Answers for question 93

Question 94

NAT · Numerical Answer 1 mark

What is the total number of times 'Hello' is printed by the program?

C
#include <stdio.h>
int main(void) {
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 4; j++) {
            printf("Hello
");
        }
    }
    return 0;
}
Answers for question 94

Question 95

NAT · Numerical Answer 1 mark

What value is printed by this recursive program?

C
#include <stdio.h>
int f(int n) {
    if (n <= 1) return 1;
    return f(n - 1) + f(n - 2);
}
int main(void) {
    printf("%d", f(5));
    return 0;
}
Answers for question 95
Scroll to Top