#include void printBits(int i) { int k; for (k = 7; k >= 0; k--) if ( (i & (1 << k)) == 0 ) putchar('0'); else putchar('1'); } int main() { char c; while (1) { printf("\n\nEnter a character: "); scanf("%c", &c); getchar(); printf("\nYou have enter the character: %c\n\n", c); printf("Internally, this character is stored as the binary number: "); printBits(c); printf("\n"); printf("The symbol represented by this code (in ASCII) is: %c\n", c); printf("This is decimal number represent by this code (in 2's compl) is: %hhd\n", c); printf("\nWe can add 1 to this number:\n"); printf(" this number + 1 = %hhd\n", c+1); printf(" it's binary representation = "); printBits(c+1); printf("\n"); printf("The symbol represented by code+1 (in ASCII) is = %c\n", c+1); printf("\n\n"); } }