#include<conio.h>
#include<iostream.h>
#include<iomanip.h>
void main()
{
int i,j,num,c;
clrscr();
cout<<"Enter number:-";
cin>>num;
cout<<setw(num+2)<<"*\n";
for(c=2,i=num;i>0;i--)
{
cout<<setw(i)<<"*";
for(j=1;j<=1;j++)
{
cout<<setw(c)<<"*";
}
c=c+2;
cout<<"\n";
}
getch();
}
#include<iostream.h>
#include<iomanip.h>
void main()
{
int i,j,num,c;
clrscr();
cout<<"Enter number:-";
cin>>num;
cout<<setw(num+2)<<"*\n";
for(c=2,i=num;i>0;i--)
{
cout<<setw(i)<<"*";
for(j=1;j<=1;j++)
{
cout<<setw(c)<<"*";
}
c=c+2;
cout<<"\n";
}
getch();
}
0 comments:
Post a Comment