Diamond Shape Using Alphabet
Write a program to create the following Pyramid using C program?
A
A B
A B C
A B C D
A B C D E
A B C D E F
A B C D E
A B C D
A B C
A B
A
*****************************Program************************
*****************************Output*************************
A
A B
A B C
A B C D
A B C D E
A B C D E F
A B C D E
A B C D
A B C
A B
A
*****************************Program************************
#include<stdio.h> #include<conio.h> main() { int r,c,k,m,i; printf("Enter the number of lines : "); scanf("%d",&m); for(r=1;r<=m-1;r++) { i=0; for(c=1;c<=m-r;c++) { printf(" "); } for(k=1;k<=r;k++) { printf("%c ",65+i); i++; } printf("\n"); } for(r=0;r<=m-1;r++) { i=0; for(k=1;k<=r;k++) { printf(" "); } for(c=1;c<=m-r;c++) { printf("%c ",65+i); i++; } printf("\n"); } getch(); return 0; }
*****************************Output*************************
screen shot for Diamond shape using alphabet |
Please send explanation of this program with it
ReplyDeleteSimplest explanation , thanks for this program
ReplyDeleteSir you can difine in c programe
ReplyDeletein every c programe can easy way difine or solve.sir i want ask questio*(1):-How can logic any programe to find the solution
Thanks for sharing the post.. parents are worlds best person in each lives of individual..they need or must succeed to sustain needs of the family. c program to find lcm of n numbers
ReplyDeleteGreat and that i have a nifty provide: How Many Houses Has Hometown Renovated home interior renovation
ReplyDelete