You're given a number N. Print the first N lines of the below-given pattern.
#include <iostream>
using namespace std;
int main()
{
int n, i, j;
cin>>n;
for(int i=0; i<=n; i++){
for(int j=i; j<n; j++){
cout<<" ";
}
for(int j=1; j<=i; j++){
cout<<"*";}
cout<<"\n";
}
}
Click on the above button to download the code.