Why is base case being hit twice

why is base case being hit twice

@Parmeet-Kalsi-1631789033630118 hey can you elaborate what you are asking?

please run the code and them tell me what is wrong with it

I got it
By mistake i had written cout in the rec case.

@Parmeet-Kalsi-1631789033630118 Ok bro,glad you find it yourself.Feel free to ask any doubt and if doubt is resilve please close the doubt.