In this program, you'll learn to print half pyramid of numbers.
#include <iostream>
using namespace std;
int main()
{
int i,j;
for (i=0; i<5; i++)
{
for (j=0; j<=i; j++)
{
cout<< j+1 << " ";
}
cout<< "\n";
}
return 0;
}
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5