Q:

C++ program to print ASCII value of a character.

0

C++ program to print ASCII value of a character.

 

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

C++ program (Code Snippet) - Get ASCII of a Character

Let’s consider the following example:

/*C++ program to print ASCII value of a character*/

#include<iostream>

using namespace std;

int main(){
	char x;
	x='A';
	
	cout<<"ASCII value of "<<x<<" is "<<(int)x<<endl;
	
	return 0;
}

Output

    ASCII value of A is 65

 

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now