Computer Sciences > Gate 2019 > Recursion
Consider the following C program:

#include<stdio.h>
int r(){
    int static 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?
A
41
B
52
C
63
D
630

Correct : b

Similar Questions

Consider the following C program: void convert(int n) { &nbsp; &nbsp; if (n < 0) &nbsp; &nbsp; printf(β€œ % d”, n); &nbsp; &nbsp; else { &nbs...
#241 MCQ
Consider the following C function. int fun (int n) { &nbsp; &nbsp; int x=1, k; &nbsp; &nbsp; if (n==1) return x; &nbsp; &nbsp; for (k=1; k < n; ++k) &...
#527 Fill in the Blanks
Consider the following program written in pseudo-code. Assume that x and y are integers. Count (x, y) { &nbsp; &nbsp; if (y !=1 ) { &nbsp; &nbsp; &nbsp; &n...
#606 Fill in the Blanks

Related Topics

No tags found

Unique Visitor Count

Total Unique Visitors

Loading......