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

Questions 16-20 of 100

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

Question 16

MCQ · Single Correct 1 mark

Where are static variables allocated in the C memory layout?

Answers for question 16

Question 17

MCQ · Single Correct 1 mark

What happens when a static local variable is initialized inside a function?

Answers for question 17

Question 18

MCQ · Single Correct 1 mark

What is the default storage class for local variables declared inside a C function block?

Answers for question 18

Question 19

MCQ · Single Correct 1 mark

What will be the output of the following program?

C
#include <stdio.h>
void count_calls(void) {
    static int c = 0;
    c++;
    printf("%d ", c);
}
int main(void) {
    count_calls();
    count_calls();
    count_calls();
    return 0;
}
Answers for question 19

Question 20

MCQ · Single Correct 1 mark

What is the default initial value of an uninitialized static variable in C?

Answers for question 20
Scroll to Top