Print this pattern
by nested for loop
1AAAAA
22BBBB
333CCC
4444DD
55555E
Answers
Answered by
4
Answer:
Hey, Here your solution!
Explanation:
#include <stdio.h>
int main() {
char c = 'A';
int i, j;
for (i = 1; i < 6; ++i) {
for (j = 1; j < 7; ++j) {
(i >= j) ? printf("%d", i) : printf("%c", c + i - 1);
}
puts("");
}
}
Similar questions