GATE CSE C Programming Practice Test – Function & Storage Class | Set 1

Questions 31-35 of 100

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

Question 31

MCQ · Single Correct 2 mark

What is the scope and linkage of a top-level global variable declared as 'static int var = 31;' in a C source file?

Answers for question 31

Question 32

MCQ · Single Correct 1 mark

What is the output of the following C code?

C
#include <stdio.h>
int x = 32;
int main(void) {
    int x = 42;
    {
        int x = 52;
        printf("%d ", x);
    }
    printf("%d", x);
    return 0;
}
Answers for question 32

Question 33

MCQ · Single Correct 2 mark

Consider a function returning a value: 'int calc(int a) { static int s = 33; s += a; return s; }'. What is returned by calling calc(5) twice consecutively?

Answers for question 33

Question 34

MCQ · Single Correct 1 mark

What does the declaration 'extern int arr[34];' inside a function indicate?

Answers for question 34

Question 35

MCQ · Single Correct 2 mark

What is the effect of declaring a function parameter as 'register int count' in C?

Answers for question 35
Scroll to Top