M
michelle c
Guest
The problem I have is that I have to display the following:
**
****
******
********
**********
the instructions have to display the pattern above: (2 asterisks, 4, 6, 8, 10, and 12). I have the following but it is not working. please help
#include <iostream>
using namespace std;
int main()
{
//declare constants and variables
int x = 0;
int y = 0;
for (int x = 1; x <= 5; x = x + 1)
{
for (int y = 1; y != x; y = y + 1)
cout << "*";
}
return 0;
} //end of main function
**
****
******
********
**********
the instructions have to display the pattern above: (2 asterisks, 4, 6, 8, 10, and 12). I have the following but it is not working. please help
#include <iostream>
using namespace std;
int main()
{
//declare constants and variables
int x = 0;
int y = 0;
for (int x = 1; x <= 5; x = x + 1)
{
for (int y = 1; y != x; y = y + 1)
cout << "*";
}
return 0;
} //end of main function