This might be really simple, but i was wondering why if you have this code it prints out -21?
#include <stdio.h>
main() {
printf("-%d",025);
}
025 is octal == 2 * 8 + 5 == 21 decimal
You have a minus sign in front of your integer format string placeholder, therefore it prints -21
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With