GATE CSE C Programming Practice Test – Function & Storage Class | 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

In C memory layout, where are static local variables and automatic local variables stored respectively?

Answers for question 1

Question 2

MCQ · Single Correct 1 mark

What is the compilation result of attempting to declare 'static register int val;' inside a C function?

Answers for question 2

Question 3

MCQ · Single Correct 1 mark

What happens to the caller variables 'a' and 'b' when calling 'swap(a, b)' where 'swap' is defined as 'void swap(int x, int y) { int t=x; x=y; y=t; }'?

Answers for question 3

Question 4

MCQ · Single Correct 1 mark

What is the output of the following C program?

C
#include <stdio.h>
int main(void) {
    extern int num;
    printf("%d", num);
    return 0;
}
int num = 85;
Answers for question 4

Question 5

MCQ · Single Correct 1 mark

Which of the following operations is illegal on a variable declared with the 'register' storage class specifier in C?

Answers for question 5
Scroll to Top