Today we will study program for Pattern of stars* in C++


#include<iostream.h>

#include<conio.h>
void main()
{
 clrscr();

 int i,j,k;


 for(i=1;i<=3;i++)
 {
  for(j=3;j>i;j--)
  {
   cout<<" ";
  }
  for(k=1;k<=2*i-1;k++)
  {
   cout<<"*";
  }
  cout<<endl;
 }

 for(i=2;i>=1;i--)
 {
  for(j=2;j>=i;j--)
  {
   cout<<" ";
  }
  for(k=1;k<=2*i-1;k++)
  {
   cout<<"*";
  }
  cout<<endl;
 }
getch();
}
Posted by Unknown On Friday, April 12, 2013 No comments

0 comments:

Post a Comment

  • RSS
  • Delicious
  • Digg
  • Facebook
  • Twitter
  • Linkedin
  • Youtube

Like us

    as

    Contact Form

    Name

    Email *

    Message *