int x=foo(1000,1500); // this line in main called foo
foo(1000,1500) $\rightarrow$ bar(1000,1500) $\rightarrow$ bar(500,1000) $\rightarrow$ bar(0,500)
now coming bakwards from the recursive stack
bar(0,500) returns n= 500 to bar(0,500)
bar(0,500) returns 500 to bar(500,1000)
bar(500,1000) returns 500 to bar (1000,1500)
bar(1000,1500) returns 500 to foo(1000,1500)
Now in foo
return(m*n/bar(m,n));
becomes
return(1000*1500/500); = return(1000,*3) = return 3000
so foo(1000,1500) returns 3000 to x in main()
printf("%d",x); // prints 3000.
$\therefore$ Output is 3000.