I don't see 'a methodology' in such a code. It is
C
, however, it has its rules and your code breaks some of them (e.g.
main
return value must be
int
).
That's said, it is not difficult to foresee the output by code inspection (or using a debugger, as
ppolymorphe already suggested):
int x,y,s=2;
s *= 3;
then
f(6)
is executed and its result assigned to
y
, let's follow
f(6)
execution:
a += -5; t -= 4; return(a + t);
hence
y=f(6)=5
.
I suppose you are now able to figure out the value assigned to
x
by
g(6)
execution.