Hello, I,m trying to get this output from some nested loops, which is becoming very frustrating. So far this is what i have.
Entering D:
A
AB
ABC
ABCD
whereas i need the following type of output:
A
ABA
ABCBA
ABCDCBA
ABCDEDCBA
Except not like this but in pyramid shape.
I've been at this for hours but can't figure it out-any help would be much appreciated!!
#include <stdio.h>
#include <ctype.h>
int main(void)
{
int x,y;
char ch,in;
printf("Get a Capital character: ");
scanf("%c",&in);
for (x = 'a'; x <= in; x++)
{
for (ch = 'a';ch <= x;ch++)
printf("%c",toupper(ch));
printf("\n");
}
return 0;
}