1#include<iostream>
2using namespace std;
3int main ()
4{
5 char c;
6 cout << "Enter a character : ";
7 cin >> c;
8 cout << "ASCII value of " << c <<" is : " << (int)c;
9 return 0;
10}
1#include<iostream.h>
2#include<conio.h>
3void main()
4{
5 char a;
6 clrscr();
7 cout<<"\nEnter any key: ";
8 cin>>a;
9 cout<<"ASCII value of "<<a<<" is: "<<int(a);
10 getch();
11}
1int main()
2{
3 char *s="hello";
4 while(*s!='\0')
5 {
6 printf("%c --> %d\n",*s,*s);
7 s++;
8 }
9 return 0;
10}