+1 vote
117 views
void find(int x){
static int i=10,y=0;
y=y+i;
for(i;i>0;i=i-10){
if(x!=0)
find(x-1);
else{
printf("%d",y);
}
}
}

What will be output printed for find(4)?

0
$50$
+1
+1
@ankit
can u explain - why i value decrementing one time only?
0
pardon mam...I did mistake that time..you are right..it will not be decremented one time :p
0
ok,

that means i value will be decremented, but decremented after x value is 0.

why that?

is it because first iteration of for loop, is after all function call is completed?
0
yes
0

output: 50

final value of i : -40

0
0
50 is a answer does i = I-10 because of tailed recursion will be executed after function call

1
2