1
0

rows2.c 339 B

123456789101112131415161718
  1. // rows2.c -- using dependent nested loops
  2. #include <stdio.h>
  3. int main(void)
  4. {
  5. const int ROWS = 6;
  6. const int CHARS = 6;
  7. int row;
  8. char ch;
  9. for (row = 0; row < ROWS; row++)
  10. {
  11. for (ch = ('A' + row); ch < ('A' + CHARS); ch++)
  12. printf("%c", ch);
  13. printf("\n");
  14. }
  15. return 0;
  16. }