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?int r(){
int static num=7;
return num--;
}
int main() {
for(r();r();r()) {
printf("%d ",r());
};
return 0;
}
Correct : b
Similar Questions
Consider the following C program:
void convert(int n) {
if (n < 0)
printf(β % dβ, n);
else {
&nbs...
Consider the following C function.
int fun (int n)
{
int x=1, k;
if (n==1) return x;
for (k=1; k < n; ++k)
&...
Consider the following program written in pseudo-code. Assume that x and y are integers.
Count (x, y) {
if (y !=1 ) {
&n...
Total Unique Visitors
Loading......