C Programming |
How To Print E-Shape Pyramid In C Posted: 28 Aug 2014 10:29 AM PDT Q. How to print or wap to a E-Shape Pyramid in C language as? ***** * *** * ***** Ans. /*e-shape pyramid in c*/ #include<stdio.h> int main() { int num=5,r,c; for(r=1; r<=num; r++) { if(r%2==0) printf("*"); else if(r%3==0) { for(c=1; c<=r; c++) printf("*"); } else { for(c=1; c<=num; c++) printf("*"); } printf("\n"); } getch(); return 0; } /*********************************************************** The output of above program would be: ***********************************************************/
You might also like: |
You are subscribed to email updates from C Programming To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 20 West Kinzie, Chicago IL USA 60610 |
Post a Comment