Half Star Pyramid

Description:

Program to print half pyramid using * Input :The number of lines of the pyramid * * * * * * * * * * * * * * * Test Case 1 Input (stdin) 5 Expected Output * * * * * * * * * * * * * * * Test Case 2 Input (stdin) 4 Expected Output * * * * * * * * * *

Program :

#include <iostream>

using namespace std;

int main()

{

int n,i,j;

  cin>>n;

  for(i=0;i<n;i++)

  {

  for(j=0;j<=i;j++)

    cout<<"* ";

    cout<<"\n";

  }

return 0;

}