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

Questions 36-40 of 100

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

Question 36

MCQ · Single Correct 1 mark

What is the output of the code snippet?

C
#include <stdio.h>
int main(void) {
    char *s = "GATE2026";
    printf("%s", s + 4);
    return 0;
}
Answers for question 36

Question 37

MCQ · Single Correct 1 mark

What happens when attempting to modify a character in a string literal via pointer: 'char *s = "hello"; s[0] = 'H';'?

Answers for question 37

Question 38

MCQ · Single Correct 1 mark

What is the difference between pointer subtraction 'p2 - p1' where both point to elements of the same array?

Answers for question 38

Question 39

MCQ · Single Correct 1 mark

What will be printed by the program?

C
#include <stdio.h>
int main(void) {
    int a[] = {1, 2, 3, 4, 5};
    int *p = a;
    printf("%d ", *p++);
    printf("%d", *p);
    return 0;
}
Answers for question 39

Question 40

MCQ · Single Correct 1 mark

Consider 'int a[5] = {1, 2, 3, 4, 5};'. What is the value of '2[a]'?

Answers for question 40
Scroll to Top