c 2b 2b get ascii value of char

Solutions on MaxInterview for c 2b 2b get ascii value of char by the best coders in the world

showing results for - "c 2b 2b get ascii value of char"
Evan
29 Nov 2019
1//It is almost know to everybody , how to print an ASCII code of a character.
2#include <bits/stdc++.h>
3using namespace std;
4int main()
5{
6	int var=65;
7	cout<<(char)var<<endl; //By this way, you can get the character with that mentioned ASCII code.
8	return 0;
9}
Frida
07 Jan 2019
1#include<iostream>
2using namespace std;
3int main ()
4{
5    char c;
6    cout << "Enter a character : ";
7    cin >> c;
8    cout << "ASCII value of " << c <<" is :  " << (int)c;
9    return 0;
10}
Ali
16 Oct 2017
1#include<iostream.h>
2#include<conio.h>
3void main()
4{
5  char a;
6  clrscr();
7  cout<<"\nEnter any key: ";
8  cin>>a;
9  cout<<"ASCII value of "<<a<<" is: "<<int(a);
10  getch();
11}
similar questions
queries leading to this page
c 2b 2b get ascii value of char