code:
#include <stdio.h>
void diamond (char x,char y)
{
int i,j;
for(i=0; i<7; i++)
{
for(j=0; j<abs(i-3); j++)
putchar(' ');
putchar(x);
for(j=0; j<5-2*abs(i-3); j++)
putchar(x);
if(j>0)
putchar(y);
putchar('\n');
}
}
info (char x,char y)
{
printf("Please enter a letter (A-Z):");
scanf("%c",&x);
printf("Please enter another letter (A-Z):");
fflush(stdin);
scanf("%c",&y);
}
main(char x,char y)
{
info(x,y);
diamond(x,y);
}
#include <stdio.h>
void diamond (char x,char y)
{
int i,j;
for(i=0; i<7; i++)
{
for(j=0; j<abs(i-3); j++)
putchar(' ');
putchar(x);
for(j=0; j<5-2*abs(i-3); j++)
putchar(x);
if(j>0)
putchar(y);
putchar('\n');
}
}
info (char x,char y)
{
printf("Please enter a letter (A-Z):");
scanf("%c",&x);
printf("Please enter another letter (A-Z):");
fflush(stdin);
scanf("%c",&y);
}
main(char x,char y)
{
info(x,y);
diamond(x,y);
}