Star pattern 4

 




#include<iostream>
using namespace std;
int space;
int row=5;
int main(){
    for( int i=1;i<=5;i++){
        for(space=1;space<=(row-i);space++)
        {
            cout<<" ";
        }
        for (int j=1;j<=i;j++)
        {
            cout<<"* "; // add some space just after star

        }
        cout<<"\n";
    }
    return 0;
   
}



Comments

Popular posts from this blog

React Installation with Vite and Tailwind css (Steps to Installation)

Insert Data In mongoDb

Class methods as an alternative Constructor