You are on page 1of 1

Pyramid 1

============================================
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int mid;
cout<<"Enter The Length of The diamond: ";
cin>>mid;
int s=mid+mid;
int f1=mid;
int f2=mid;
for (int i=1;i<mid;i++)
{
for (int j=1;j<=s;j++)
{
if (j<=f1&&j>=f2)
cout<<"*";
else
cout<<" ";
}
f1++;
f2--;

cout<<endl;
}

getch();

http://www.ravianeducation.blogspot.com
FARHAN: 03008855006