This is the C program for converting a character into ASCII value.
In this Program User ask to convert a Character to ASCII value. Formal Char type Variable Declared for containing and computing the value. With use of scanf() user ask the value to run time position. With the use of (%u) unsigned-int used as Pointers (when treated as numbers) will fetch the result.
Problem Statement:
- This is the program to convert the Character value Into ASCII Format.
- Entering the Value.
- Display the result on Screen.
Here is source code of the C program to convert the Character value Into ASCII Format. The C program is successfully compiled. The program output is also shown below.
#include<stdio.h>
void main()
{
char a;
clrscr();
printf("Enter the Character : ");
scanf("%c",&a);
printf("The ASCII Code is : %u",a,a);
getch();
}
Output :
Enter the Character : a
The ASCII Code is : 97