Social Icons

Saturday, 15 February 2014

Program to Find ASCII value of a character and its next character

#include<iostream.h>
#include<conio.h>

void main()
{
clrscr();
char ch,c;
int char1;
cout<<"\n Enter a character : ";
cin>>ch;
char1=ch;
cout<<"\n\t ASCII value of "<<ch<<" is : "<<char1;
c=ch+1; char1=c;
cout<<"\n\n\n Adding one to the character  ";
cout<<"\n\n\t ASCII value of "<<c<<" is : "<<char1;
getch();
}


                                                       Output



No comments:

Post a Comment