===========================================================================
CODING
#include<all.h>
void main()
{
clrscr();
int n,i,j,k;
cout<<"Enter number: ";
cin>>n;
clrscr();
for(k=1;k<=n;k++)
cout<<"* ";
cout<<"\n";
for(i=1;i<=n-2;i++)
{
cout<<"* ";
for(j=1;j<=n-2;j++)
cout<<" ";
cout<<"* \n";
}
for(k=1;k<=n;k++)
cout<<"* ";
getch();
}
CODING
#include<all.h>
void main()
{
clrscr();
int n,i,j,k;
cout<<"Enter number: ";
cin>>n;
clrscr();
for(k=1;k<=n;k++)
cout<<"* ";
cout<<"\n";
for(i=1;i<=n-2;i++)
{
cout<<"* ";
for(j=1;j<=n-2;j++)
cout<<" ";
cout<<"* \n";
}
for(k=1;k<=n;k++)
cout<<"* ";
getch();
}
===========================================================================
No comments:
Post a Comment