C++ Program to print half pyramid using *
//C++ Program to print half pyramid using *
//header files
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int rows;
cout << "Enter number of rows: ";
cin >> rows;
for(int i = 1; i <= rows; i++)
{
for(int j = 1; j <= i; j++)
{
cout << "* ";
}
cout << "\n";
}
getch();
}
Output
