GATE | GATE CS Mock 2018 | Question 39
Consider the following C-program :
int fun() { static int num = 16; return num--; } int main() { for(fun(); fun(); fun()) printf("%d ", fun()); return 0; } |
chevron_right
filter_none
What is output of above program?
(A) Infinite loop
(B) 13 10 7 4 1
(C) 15 12 8 5 2
(D) 14 11 8 5 2
Answer: (D)
Explanation: Option (D) is correct. Refer : https://www.geeksforgeeks.org/c-storage-classes-and-type-qualifiers-question-9/
Quiz of this Question
Recommended Posts:
- GATE | GATE CS 1999 | Question 36
- Top 5 Topics for Each Section of GATE CS Syllabus
- How to prepare in Last 10 days to score high in GATE?
- Aptitude | GATE IT 2006 | Question 7
- Aptitude | GATE IT 2006 | Question 8
- GATE | GATE CS 2013 | Question 1
- GATE | GATE CS 2013 | Question 3
- GATE | GATE CS 2013 | Question 4
- GATE | GATE CS 2013 | Question 65
- GATE | GATE CS 2013 | Question 6
- GATE | GATE CS 2013 | Question 7
- GATE | GATE CS 2013 | Question 8
- GATE | GATE CS 2013 | Question 65
- GATE | GATE CS 2013 | Question 65
- GATE | GATE CS 2013 | Question 11


