Menu BAR

FEEL FREE TO ASK ANY PROGRAM and please mention any error if you find it

28 Aug 2013

STAR PATTERN2

Write a program to print the following star pattern

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

#include<iostream.h>
#include<conio.h>
void main()
{
 clrscr();
 int i,j,n;
 cout<<"Enter number of rows"<<endl;
 cin>>n;
 for(i=n;i>=1;i--)
  {
   for(j=1;j<=i;j++)
    {
     cout<<"*";
    }
   cout<<endl;
 }
 getch();
}

==OUTPUT==


1 comment: