Please tell why is this code not getting into infinite loop

#include<stdio.h>

int fun(int i)

{
if ( i%2 ) return (i++);

else return fun(fun( i - 1 ));

}

int main()

{

printf(" %d ", fun(200));

return 0;

}

Correct me iwhere i am going wrong somewhere in my interpretation of the code.

first in main() inside from printf sends a call to fun function

then inside if(200%2) becomes false so else is returned

in which return says fun(fun(199))

and then again inside if(199%2) this becomes true so it will return 200

so fun(fun(200)) the nested function valuse is 200 so return is fun(200) it will run and if will become false and else will run which says return fun(fun(199))

so this an infinite loop

hey, we had a word on this in chat in the previous thread, please mark this as resolved

Your approach didn’t solved my problem so I have asked again

okay, see
first in main() inside from printf sends a call to fun function

then inside if(200%2) becomes false so else is returned

in which return says fun(fun(199))
and then again inside if(199%2) this becomes true so it will return 199 only since it returns before increment
then fun(199) is called and it again returns 199 only for the same reason and that is end of calling

post increment returns before incrementing
if u pre increment then it is an infinite loop

Thanks now I got it I had read somewhere wrong on internet about increment operators thanks for the help