Q1 ). Write the code for given below pattern
=> C++ Coding :
#include<iostream>
using namespace std;
int main(){
int n;
cout<<"Enter the size of input : ";
cin>>n;
for(int i=1;i<=n;i++){
for(int j=1;j<=n-i;j++){
cout<<" ";
}
for(int j=1;j<=i;j++){
cout<<"* ";
}
cout<<endl;
}
}
Comments
Post a Comment