Skip to content

Instantly share code, notes, and snippets.

@muhammedfurkan
Created December 26, 2020 21:36
Show Gist options
  • Save muhammedfurkan/0386772275a70449db233ef4dc0da2b1 to your computer and use it in GitHub Desktop.
Save muhammedfurkan/0386772275a70449db233ef4dc0da2b1 to your computer and use it in GitHub Desktop.
diamond shape with English Alphabeth Letters from A to Z
#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