Wednesday, 8 July 2015

Pattern in C++

#include<iostream>
using namespace std;
int main()
{
int i,s,a,d;
cout<<"enter the num: ";
cin>>a;

for(i=1; i<=a; i++){

for(d=1; d<=i; d++){
cout<<" ";
cout<<"*";
for(s=1; s<=i; s++){

}

}
cout<<endl;
}
}

0 comments:

Post a Comment