by Dinesh Thakur Category: C Programming (Pratical)

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


About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.