can somebody explain why does this code print 5 A's AAAAA
and not 4 A's AAAA
value of char 'A' - 65
, 'B' - 66
and 'Z' - 90
#include <stdio.h>
int main() {
char a = 'B', b = 'A';
while (a++ < 'Z') {
if (a % 5 == 0)
printf("%c", b);
}
return 0;
}
I calculated multiple times and I got 4 A's as a result, so I do not understand why correct answer is 5 A's