i have a codes like this
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
for(int a=1;a<6;a++)
{
for(int b=1;b<6;b++)
{
cout <<"*";
}
cout <<endl;
}
getch();
return 0;
}
its too complex for me to convert it to recursive form ,any idea how to convert it?
Let me edit your post into a readable form.
This is my program:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
for(int a=1;a<6;a++)
{
for(int b=1;b<6;b++)
{
cout <<"*";
}
cout <<endl;
}
getch();
return 0;
}
|
This conversion is more complicated than I know how to do, does anybody know how?
There, now your post is readable.
Now, there is something glaringly obvious about where to use recursion, not that I think this is a good place to use recursion.
Last edited on