Consider the following C program: #include <stdio.h> int r(){ static int…

GATE · 2019 · CS · Computer Science & IT

Consider the following C program:

#include <stdio.h>
int r(){
    static int num=7;
    return num--;
}

int main(){
    for (r();r();r())
         printf(“%d”,r());
    return 0;
}

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

Attempted by 302 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…