Hi, Hope everyone are in good health. Today I will you how to print special character and alphabets in C programming language using ASCII codes. It is very simple and easy.
As you can see, we declare an integer variable ‘n’. We initialized the variable to 33. Now here is the twist. In the printf() function we use the format specifier “%c” which is for character. So, it will print a character. Which character? As ‘n’ is carrying the 33, this will print the character followed by the ASCII Table. Try changing the value of ‘n’. ASCII-8 contains 255 character.
Find out the full ASCII Table from here.
You can try something like the following image using ASCII codes:
Thank you. Have fun. Happy Coding 🙂