/*
program to generate following pattern......
*
***
*****
*******
*********
*/
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int i,j,r,a=1;
for(i=1;i<=5;i++)
{
for(j=5;j>i;j--)
{
cout<<" ";
}
for(r=1;r<=a;r++)
{
cout<<"*";
}
cout<<'\n';
a+=2;
}
getch();
}
program to generate following pattern......
*
***
*****
*******
*********
*/
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int i,j,r,a=1;
for(i=1;i<=5;i++)
{
for(j=5;j>i;j--)
{
cout<<" ";
}
for(r=1;r<=a;r++)
{
cout<<"*";
}
cout<<'\n';
a+=2;
}
getch();
}
0 comments:
Post a Comment