program to display ASCII code

program to display ASCII code


Hello friends today C for fun brings you the program to display ASCII code of the given character every character is having it special ASCII code which is unique as the fingerprints which human have so what is the use of the code why are the given to the variables or any other this question might arise in your mind show the simple answer which can be stated as is that to differentiate between the different characters are the values you have entered if there would be same value for the variables that it would be creating a Hustle for the compiler and the result would not be as expected.




in c programming a character  has an ASCII value you will learn about them in the program given below

A detailed note on the coding and the code which the program holds has been given below you may go through the coding and the algorithm and the explanation for the ASCII code values if you have any doubt you may ask or post in the comment section.


a character holds the value(integer value)rather than that character itslf.what does it mean is that for example if you assign A to a variable, 65 is stored as its value which is nothing but its ASCII value

Source code of a program has been supplied as an example for the coding language of ASCII code you may use it and find out the different ASCII code used by the compiler in the C language


#include<stdio.h>
#include<conio.h>
void main()
{
char ch;
clrscr();
printf("enter any character");
scanf("%d",&ch);
printf("%c ASCII code is=%d",ch,ch);
getch();
}

output
enter any character
a
an ASCII code is =97

try other examples by changing the alphabet, and comment down the different code you obtained.


Now when you have used the ASCII code comment down the different result you have obtained by changing the different values of the input share your experience of the ASCII code let's play a game first guess the ASCII code of a character then find out the same from the program comment down that result and let's begin a train of that.

Share this program among your friends and family members whom you think might help them to build a basic knowledge of the coding language.
C4fun is based on the sharing concept, help us and others to grow and help out your friends to make out of basic program of ASCII code by using the simple logic

In our blog you will find the simple and the basic logic programs which help you to understand the functionality how it perform and the step by step guide to help you out.




If you have any questions you may ask or drop in the comment section they would be response in no time keep learning
Keep sharing
Keep coding.....

No comments

thanks for reading and sharing.I hope it would help you!!!!

Powered by Blogger.