Answers for "convert char to ascii code c++"

C++
10

char ascii c++

#include<iostream>
using namespace std;
int main ()
{
    char c;
    cout << "Enter a character : ";
    cin >> c;
    cout << "ASCII value of " << c <<" is :  " << (int)c;
    return 0;
}
Posted by: Guest on June-24-2020
0

c++ program to convert character to ascii

/*Q; Design a program that take a char value from the 
user and display the ASCII value of the entered value?*/
#include<iostream>
using namespace std;
int main()
{
	char a;
	cin>>a;
	int num=(int)a;
	cout<<"\nASCII value of "<<a<<"="<<num;
	return 0;
}
Posted by: Guest on March-17-2022

Code answers related to "convert char to ascii code c++"

Browse Popular Code Answers by Language