Hi everyone! Please don't bag me about this....
I've researched every textbook, visited at least 25 sites, looked at more tutorials than I can remember and I still can't solve this problem.
It's a easy problem as I'm only a newbie but please help me.... I've have been racking my brains for over a week now...
Here it is.
I'm trying to display this pattern with using just nested for loops but I don't know how...
*****
****
***
**
*
This is what I've got so far but that's it. I'm stuck!!!
#include <iostream.h>
main()
{
for (int a = 1; a <= 5; a++) //First loop. The condition is
//true so it will continue to next loop
{
for (int b = 5; b >= a; b--) //Second loop. Also true until b is
//zero
{
cout << "*";
for (int c = b; c <= a; c++) //This is where I'm stuck!!!
//HELP. HELP.
{
cout << " ";
}
}
cout << endl;
}
}
What should I do? Is the third loop required? Do I need another loop?
Please if anyone could help me with this I will be eternally grateful