//PROGRAM TO PRINT THE DOUBLE PYRAMID
/*MADE BY KRISHNA AGARWAL*/
#include<iostream>
using namespace std;
int main()
{
int i,j,k,l,n;
cout<<"entr the no of lines";
cin>>n;
for(i=1;i<=n;i++)
{
for(j=1;j<=n-i;j++)
cout<<" ";
for(k=1;k<=2*i-1;k++)
cout<<"*";
for(l=1;l<=2*n-2*i;l++)
cout<<" ";
for(k=1;k<=2*i-1;k++)
cout<<"*";
cout<<endl;
}
return 0;
}
/*MADE BY KRISHNA AGARWAL*/
#include<iostream>
using namespace std;
int main()
{
int i,j,k,l,n;
cout<<"entr the no of lines";
cin>>n;
for(i=1;i<=n;i++)
{
for(j=1;j<=n-i;j++)
cout<<" ";
for(k=1;k<=2*i-1;k++)
cout<<"*";
for(l=1;l<=2*n-2*i;l++)
cout<<" ";
for(k=1;k<=2*i-1;k++)
cout<<"*";
cout<<endl;
}
return 0;
}
No comments:
Post a Comment