I've been playing around and trying to experiment with C for my university class and I've found something that my program does even though I did not tell it to!
My full code:
#include <stdio.h>
int main(void) {
int c;
while ((c = getchar()) != EOF) {
printf("%d\n", (c - '1'));
}
return 0;
}
The output of it looks like this:
7
6
-39
Now, can anyone tell me why that -39 is being printed?