GATE CS 2019 (Forenoon) — Question 37

Programming in CFunctions, Parameter Passing, Scope Rules, RecursionMCQ2 marks · −2/3 if wrongMedium

Consider the following C program:
c
1#include<stdio.h>
2int r( )
3{
4    static int num = 7;
5    return num--;
6}
7int main( )
8{
9    for ( r( ); r( ); r( ) )
10        printf("%d", r( ) );
11    return 0;
12}
13
Which one of the following values will be displayed on execution of the programs?
  1. A
    41
  2. B
    52
  3. C
    63
  4. D
    630
Practise the full 2019-FN paper
Challenge a friend: WhatsApp Telegram
From RENYXERAWhat rank do your marks get?GATE score, likely All-India Rank and qualifying marks for your category.
Practise more on Functions, Parameter Passing, Scope Rules, RecursionTimed, in the real exam interface · free to start

A GATE question every morning

One real past-paper question every morning for your branch, answer hidden until you tap. Free on Telegram.

Join
Stuck? Ask in the student group