ANS → Y=50 .
As here variable i and y both are static so all the updations will be saved in it.
void find(int x)
{ static int i = 10, y = 0 ; //LINE 1
y = y + i; //LINE 2
}
Now in LINE 1 i=10 and y=0
LINE 2 y=y+10 // y=10
for(i; i>0; i = i - 10)
{
if(x! = 0)
find(x – 1);
else
printf(“%d”, y);
}
in the first iteration of this loop .
i=10 , y=10 // it will enter the loop
x=4 and x!=0
thus go inside if and find(x-1) i.e find(3)
so for find(3) → y=y+i again i.e y=10+10 // 20
then again for find(2) → y=y+i again i.e y=20+10 // 30
then find(1) → y=y+i again i.e y=30+10 // 40
find(0) → y=y+i again i.e y=40+10 // 50
as now x =0 then it will not enter the if condition and directly prints y i.e 50.
i hope it is cleared now!!