I need to find out the output of the following code snippet return by function go(2) ...

int a=10;
int go(int b)
        return b;
        return go(b+1)*go(b-2)-(b*2);


        return -1;

When I do the dryrun myself on paper , it should first return the value of b from the line no. 5 and the display value of a in line no. 10 but when I execute the code in compiler it shows none with the returning value 0(obviously which i write in main())...can u please tell me why?

There is no way for the function to ever get to line 9. It will never display the value of a.

go(2) will return 2.


go(2) didn't continue past line 5. You may want to refresh your memory about return(). An accepted explanation is "The keyword return causes the function to exit, passing control back to the calling function."

Lines 8-12 will never be executed with the code you have. In your function you have:

    return b;
    return go(b+1)*go(b-2)-(b*2);

So if b <= 4 then you return b;. is be is anything else then you return go(b+1)*go(b-2)-(b*2);. Anything after the if will never be executed as both paths out of the if statement exit the function.

Oh wao Moschops I didn't know this Question was taken from internet.
I was solving my past papers to practice. There I found it :)

But in this link ... "Standard input is empty " is written ..what does that mean? o_o

It means there is no input to fetch from the keyboard.