JuNaiDiQbaL | 06-05-2011 03:45 PM | A Program that makes a Diamond Pattern Stars in the output. #include
#include
void main()
{ int a,b,c,i,j,k,n; clrscr(); cout<<"enter the value of n\n"; cin>>n; //for the first half of diamond for(i=n;i>0;i--)
{
for(j=1;j
{
cout<<" ";
}
for(k=j-1;k
{
cout"*";
cout<<" ";
}
cout<<"\n";
} //for the second half of diamond for(a=n-1;a
{
for(b=n;b>a;b--)
{
cout<<" ";
}
for(c=0;c
{
cout<<"*";
cout<<" ";
}
cout<<"\n";
} getch(); } |