jituTechnology

jituTechnology

A program to read the graphical character and print their equivalent ASCII code and vice versa

Here is the C source code to read the graphical characters given by user and print their equivalent ASCII code using simple input output operation.
/*A program to read the graphical character and print their equivalent ASCII code*/
#include <stdio.h>
#include <conio.h>
void main()
{
    char a; //variable declaration
   printf(“enter the graphical character to print ASCII code: “);
   scanf(“%c”,&a);
   printf(“The ascii value of %c=%d\n”,a,a);
   getch();
}
Now here is just the reverse of above program. This program will read the ascii value given by user and then it will print equivalent characters.
/* A program to read the ascii value and print the equivalent characters.
programmed by
name: Jitendra
date: 30 December 2010 */
#include <stdio.h>
#include <conio.h>
void main()
{
    int a;
   printf(“Enter the ASCII value:”);
   scanf(“%d”,&a);
   printf(“The equivalent character of %d=%c”,a,a);
   getch();
}
Writing comments in C source code is a significant of a good programmer. So write the comments where needed so that another programmer can understand what you used for what.
Add a comment

Comments (1)

  1. erp programmersOctober 12, 2012 Reply
    I am continually amazed by the amount of information available on this subject. What you presented was well researched and well worded in order to get your stand on this across to all your readers.

Add a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.



Connect with Me

GPO 8973 NPC 541; Kathmandu Nepal
Phone: +977 9851236800

Calendar

April 2024
S M T W T F S
 123456
78910111213
14151617181920
21222324252627
282930