Write a C++ program that inputs a character and displays its ASC|| code.

 #include<iostream>

using namespace std;

int main()

{

char charac;

cout<<"Enter the chatacter ";

cin>>charac;

int num1 = charac;

cout<<"The ASC|| code for "<<charac<<" is "<<num1<<"."<<endl;

}

OUTPUT

Enter the chatacter a

The ASC|| code for a is 97.

1 comment: