Hello guys, I just need some help with the code below.
I just need to fix it by successfully printing the expected output below.
My output:
123456789101112
Expected Output:
121110987654321
#include <iostream>
using namespace std;
void recursive (int n)
{
if (n == 0)
return;
recursive (n-1);
cout << n;
}
int main()
{
recursive(12);
return 0;
}
My output result is 123456789101112 and my output should print the numbers reversely. It should be 121110987654321. I just got a typo. My apologies for that. I just updated my concern above.