Wednesday 5 November 2014

Character to ASCII Code Conversion

/*A C program to implement character to ASCII code Conversion.
Author: Mangilal Saraswat
Date: 5 November, 2014*/

#include<stdio.h>
#include<conio.h>

void main()
{
 char character;
 clrscr();
 printf("Character to ASCII converter\n");
 printf(">Give input character and get ASCII code.\n");
 printf(">Give input e to exit from here.\n");
 while(1)      //loop execute untill exit by entering e
 {
  printf("Character: ");
  //use gets instead of scanf because scanf also capture pressing enter.
  gets(&character);
  if(character=='e') break;
  else printf("ASCII code: %d\n",character);
 }
}


No comments:

Post a Comment

You are welcome, your comment helps me to make this blog more better.