PROGRAM FOR SQUARE PATTERN
//program for pattern
#include<iostream.h>
#include<conio.h>
void main()
{
int i,j,n;
clrscr();
cout<<"enter no of rows:";
cin>>n;
cout<<"\n";
for(i=0;i<n;i++)
{
for(j=0;j<i;j++)
{
cout<<"* ";
}
cout<<"\n";
}
getch();
}
#include<iostream.h>
#include<conio.h>
void main()
{
int i,j,n;
clrscr();
cout<<"enter no of rows:";
cin>>n;
cout<<"\n";
for(i=0;i<n;i++)
{
for(j=0;j<i;j++)
{
cout<<"* ";
}
cout<<"\n";
}
getch();
}

Comments
Post a Comment