Showing posts with label Star 3. Show all posts
Showing posts with label Star 3. Show all posts

Wednesday, July 6, 2011

Star Pattern 3




*****
 ****
  ***
   **
    *




#include<iostream.h>
#include<conio.h>
void main()
{
  clrscr();
  int r,i,j;
  cout<<"Enter the range:"<<endl;
  cin>>r;
  for(i=0;i<r;i++)
  {
    for(j=0;j<i;j++)
    {
      cout<<" ";
    }
    for(j=i;j<r;j++)
    {
      cout<<"*";
    }
    cout<<"\n";
  }
  getch();
}