This document was uploaded by user and they confirmed that they have the permission to share
it. If you are author or own the copyright of this book, please report to us by using this DMCA
report form. Report DMCA
Diamond #include #include 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<s;i++) { for (int j=1;j<s;j++) { //if(j==f1||j==f2) //hollow if (j>=f2&&j<=f1||j>=f1&&j<=f2) //filled cout<<"*"; else cout<<" "; } f1++; f2--; if (f1==(s-1)&&f2==1) { f1=1; f2=s-1; } cout<<endl; } getch(); }
Click the link below to see more examples URL: http://ravianeducation.blogspot.com E-Mail: [email protected] Farhan: 03008855006