Why the output of the above code is 5 as the function should go to first 5-4-3-2 (since no output) loop decrements to 1 so return 12 so at last 12+1..... so the answer must not be 5 i guess ?
using namespace std;
int x()
{
}
int reee(int n)
{
for(int i=n; i>0; i--)
{
if(i==2)
{
return x();
}
else if(n==1)
{
return 12;
}
else
{
return reee(i-1)+1;
}
}
}
int main()
{
cout << reee(5) << " ";
}