Use for loops to construct a program that displays a pyramid of Xs on the screen. The
pyramid should look like this
X
XXX
XXXXX
XXXXXXX
XXXXXXXXX
#include<conio.h>
#include<iostream>
usingnamespace std;
//mainfunction
voidmain(){
//show result
for(int i = 1; i < 10; i+=2) {
cout<< "
";//shownew line
for(int j = 1; j <=i; j++)
cout << "*";// show asterisk
}
getch();//delay
}