ok so I have
#include<cmath>
#include<iostream>
using namespace std; // So the program can see cout and endl
int main()
{
int n = 4;
int line, stars, loop;
for (line = 1; line <= n; line++)
{
stars = n - line + 1;
for (loop = 1; loop <= stars; loop++)
cout << "*";
}
}
It works fine no errors except 1 it doesnt stay on screen the dos windo immedietly closes in a blink of an eye y is that? how do I make it stay open and display the shape and two how would Imake the triangle go different like with the main edge towrds awat and to the side?
#include<cmath>
#include<iostream>
using namespace std; // So the program can see cout and endl
int main()
{
int n = 4;
int line, stars, loop;
for (line = 1; line <= n; line++)
{
stars = n - line + 1;
for (loop = 1; loop <= stars; loop++)
cout << "*";
}
}
It works fine no errors except 1 it doesnt stay on screen the dos windo immedietly closes in a blink of an eye y is that? how do I make it stay open and display the shape and two how would Imake the triangle go different like with the main edge towrds awat and to the side?