♦ C++ Program to Find ASCII Value of a Character
♣ Example1: C++ Program to Find ASCII Value of a Character
Input:
xxxxxxxxxx
1
#include <iostream>
2
#include <cmath>
3
4
using namespace std;
5
6
7
char intToChar(int n){
8
return (char)n;
9
}
10
11
12
int charToInt(char c){
13
return (int)c;
14
}
15
16
17
int main() {
18
// printf(" \n",);
19
20
21
printf(" %c \n",intToChar(99));
22
23
printf(" %d \n",charToInt('A'));
24
25
26
27
28
return 0;
29
}
Output: