wrote:
> int giValue = 5; /* Global Variable Declaration */
> void fnReverse()
> {
> if (giValue > 0) {
> giValue--;
> fnReverse();
> }
> printf("%d\n",giValue);
> }
>
> /
> ************************************************** ************************************************** ********
> * why the answer is 0 six times????????????????
>
> ************************************************** ************************************************** ******/
Because you print the value of `giValue` after the recursion has been
all the way down to the bottom.
As would have been obvious if you'd tried "play machine" or attempted the
induction -- two techniques that I'd advise adding to your kit.
--
Chris "once a formalist, always (but not only) a formalist" Dollin
Hewlett-Packard Limited registered office: Cain Road, Bracknell,
registered no: 690597 England Berks RG12 1HN