11 - WAP to Print ASCII table in C
This Program prints the complete ASCII (man ASCII) table with all the values in Oct, Hex, Dec, Char.
#includeint main() { //initialization int idx; //print the header line printf("*****************ASCII TABLE*****************\n"); printf("OCT\t DEC\t HEX\t CHAR\n"); for (idx = 0; idx <= 127; idx++) { //it will print all the non printable characters if (idx <=32 || idx >= 127) { printf("%o\t %d\t %x\t Non Printable\n", idx, idx, idx); } //it will print all the printable characters else { printf("%o\t %d\t %x\t %c\n", idx, idx, idx, idx); } } return 0; }
Post a Comment