My photo
Bangalore, Karnataka, India
Extending one hand to help someone has more value rather than joining two hands for prayer

Archives

pattern1

Tuesday, September 1, 2009

#include<iostream.h>
#include<conio.h>
void main()
{
 clrscr();
 int i,j,k,l;
 for(i=1;i<=5;i++)
 {
  for(j=1;j<=i;j++)
  cout<<"*";
  for(k=1;k<=9-2*i;k++)
  cout<<" ";
  if(i<=4)
  {
  for(l=1;l<=i;l++)
  cout<<"*";
  }
  else
  cout<<"****";
   cout<<endl;
   }
  getch();
  }

0 comments: