Important Questions

C++ Program to print half pyramid using numbers

//C++ Program to print half pyramid using numbers
//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 <<j<< " ";

}
cout << "\n";

}
getch();

}

Output