A
' is 65.A
' to a character variable, 65 is stored in that variable rather than 'A
' itself.#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;
}
Enter a character: F
ASCII Value of F is 70