Trying to make this counter output something different
Right now, I am currently running through dozens and dozens of example programs to try to give myself a better understanding of loops and whatnot. Now I am fine with making loops work fine for the most part, however what I am trying to do is now change this program to output something different. Right now the output (shown at the end, first output, comes out how the program intends. However I am trying to alter it to output this instead (shown at end, second output). I'v managed to get it to output various different ways, but I Can't seem to get it to output how it's supposed to. Any enlightenment to my current situation would be loved.
Code:
#include <stdio.h>
int main(void)
{
const int ROWS = 6;
const int CHARS = 6;
int row;
char ch;
for (row = 0; row < ROWS; row++)
{
for (ch = ('A' + row); ch < ('A' + CHARS); ch++)
printf("%c", ch);
printf("\n");
}
getchar();
return 0;
}
Proper output::
ABCDEF
BCDEF
CDEF
DEF
EF
F
New intended output::
ABCDEF
ABCDE
ABCD
ABC
AB
A