/* * asciivalue.c */ #include int main(void) { char xx; // declare char xx xx='A'; // assign xx the value of A printf("The value of 'A' is %c \n", 'A'); // print A as a char printf("The ascii value of 'A' is %d\n", 'A'); // print A as a dec printf("The ascii character '65' is the %c\n", 65); // print 65 as a char printf("The value of variable xx is %c \n", xx); // print xx value as a char printf("The ascii value of the variable xx is %d\n", xx); // print xx value as dec printf("The ascii value of 'A' +3 is %d\n", 'A'+3); // add 3 to the ascii value of A and print as decimal printf("The character 'A'+3 is %c\n", 'A'+3); // add 3 to the ascii value of A and print as character printf("The ascii value of 'A'+29 is %d\n", 'A'+29); // add 29 to ascii value of A, print as decimal. printf("The character 'A'+29 is %c\n", 'A'+29); // add 29 to ascii value of A, print as char. printf("The ascii value of 'A'+32 is %d\n", 'A'+32); // add 32 to the ascii value of A, and print as a dec. printf("The character value of 'A'+32 is %c\n", 'A'+32); // add 32 to the ascii value of A, and print as a char. return 0; }