Q:

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

belongs to collection: C++ programs on various topics

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)

C++ programs on various topics

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
C++ program to print the maximum possible time usi... >>
<< C++ program to declare, define and access public s...