Hi Everyone!!!
At the end of this module, you will be able to get ASCII value from Integer using a C program.
At the end of this module, you will be able to get ASCII value from Integer using a C program.
Intro
There are many hidden tricks in C that are very useful and simple to use. Now, we are going to code a C program that converts an integer into ASCII value. Let's Go.
Logic
- Declare a character variable
- Store character value to that variable from the user ("%c")
- Print the ASCII value ("%d")
Program
Output
Trick
Here is a trick. When we convert a character value into an integer by using ("%s" to "%d"), GNU Compiler prints the ASCII value assigned to that character. This conversion is known as Type-Casting in programming.
Outro
If you like it, please share it with your friends and leave your comments below.
Comments
Post a Comment