Created
December 26, 2020 21:36
-
-
Save muhammedfurkan/0386772275a70449db233ef4dc0da2b1 to your computer and use it in GitHub Desktop.
diamond shape with English Alphabeth Letters from A to Z
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <conio.h> | |
int main() | |
{ | |
int r, c, k, m, i; | |
m = 26; | |
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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment