/* Alphabet Triangle. */
#include <stdio.h>
int main()
{
int i, j, k, l, n;
printf("Enter the range: ");
scanf("%d", &n);
for(i = 65; i <= 64+n; i++){
for(j = 65; j <= 65+64+n-i; j++){
printf(" ");
}
for(k = 65; k <= i; k++){
printf("%c", k);
}
for(l = i-1; l >= 65; l--){
printf("%c", l);
}
printf("\n");
}
return 0;
}
Comments
Post a Comment