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

Questions 6-10 of 100

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

Question 6

MCQ · Single Correct 1 mark

What is the output of the following code?

C
#include <stdio.h>
int main(void) {
    int a = 1, b = 2, c = 3;
    int res = a < b < c;
    printf("%d", res);
    return 0;
}
Answers for question 6

Question 7

MCQ · Single Correct 1 mark

What is printed by the following snippet?

C
#include <stdio.h>
int main(void) {
    int x = 10, y = 20;
    int max = (x > y) ? x : y;
    printf("%d", max);
    return 0;
}
Answers for question 7

Question 8

MCQ · Single Correct 1 mark

What is the evaluation result of the comma expression 'int x = (1, 2, 3);'?

Answers for question 8

Question 9

MCQ · Single Correct 1 mark

What will be the output of this code?

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

Question 10

MCQ · Single Correct 1 mark

What is the value of 'a' after 'a = ~0;' on a system where int is 32-bit two's complement?

Answers for question 10
Scroll to Top