Friday, November 15
Program that converts ASCII number to character and vice versa By Umair Sajid
This Program can also be done using if-else structure but switch statement is most appropriate.
#include<stdlib.h>
#include<conio.h>
using namespace std;
int main()
{
int number,option;
char letter;
cout<<"1.Convert ASCII Value to Character "<<endl;
cout<<"2.Convert Character to ASCII Value "<<endl;
cout<<"Enter Your Choice :"; cin>>option;
switch(option)
{
case 1:
cout<<"Enter The Number :";
cin>>number;
cout<<"The Corresponding character is :"<<char(number)<<endl; break;
case 2:
cout<<"Enter The Letter :";
cin>>letter;
cout<<"ASCII Value of the letter is:"<<int(letter)<<endl;
break;
default:
cout<<"*** INVALID OPTION ***";
break;
}
getch();
}
great program yaar (y)
ReplyDeleteThanKs Usama
ReplyDeletesyntax highlight nae hua
ReplyDeletehow will we convert to unicode and urdu characters
ReplyDeletelet me see if i can highlight syntax
ReplyDeleteThanks In Advance
ReplyDelete