Write a c++program that inputs a character from keyboard and display the corresponding ASCII value on the screen.

3. Write a simple C++ program that inputs a character from keyboard and display the corresponding ASCII value on the screen.



#include<iostream>
using namespace std;
int main()
{
    char c;
    cout<< "Enter a character: ";
    cin>>c;
    cout<< "ASCII value of "<<c<<" is: "<<(int)c;
}



No comments

Powered by Blogger.