123456789101112131415161718192021222324252627282930313233343536
/* A simple program to create Diamond */ #include<iostream.h> #include<conio.h> void main() { clrscr(); int i,j,k; for(i=1;i<10;i++) /*Upper half of diamond*/ { for(k=13-i;k>=1;k--) { cout<<" "; } for(j=0;j<i;j++) { cout<<"*"; cout<<" "; } cout<<"\n"; } for(i=10;i>=1;i--) /*Lower half*/ { for(k=14-i;k>=1;k--) { cout<<" "; } for(j=1;j<i;j++) { cout<<"*"; cout<<" "; } cout<<"\n"; } getch(); }