Hi I am trying to write a small C++ program using nested loops so that when the program executes I have the following output displayed
**
****
******
********
**********
************
Here is the code I have written. I seem to be having a problem with proper loop execution. I would appreciate any help in determining where I have gone wrong. I print out 14 stars ad that is it.
Thank you Steve Swickard
//I include any header files I need here
#include <iostream>
#include <string>
using std::cin;
using std::string;
using std::cout;
using std::endl;
int main()
{
//I declare variables and constants here
const char STAR ='*';
int i =0;
int j =0;
int k =0;
for(; i<7; i++) // my first loop or out loop to execute
//6 times
{
for (;j<k;j=j++) // this loop determines how many * to print
{
cout << STAR;
}
{
for (;k !=14; k=k+2) // this loop determines the max # of *
//to print
cout << endl;
}
}
return 0;
} //end of main function