by Dinesh Thakur

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:

  1. This is the program to convert the Character value Into ASCII Format.
  2. Entering the Value.
  3. 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