ASCII Value Of Character In C++ | Programming - PrepInsta
Maybe your like
Unlock this article for Free, by logging in
Don’t worry, unlock all articles / blogs on PrepInsta by just simply logging in on our website
C++ Program to print ASCII value of a characterOctober 14, 2022
To find ASCII value of a Character in C++
Here, on this page we will discuss the program to find the ASCII value of a character in C++ .The variable of char data type can hold basically three types of characters. These characters can be differentiated on the basis of ASCII value which have been assigned to them.
Did you know?
ASCII stands for American Standard Code for Information Interchange
- Which is a binary code used by electronic equipment for electronic communications
- A total of 128 characters have been assigned values from 0 – 127
- Alphabets ( 65 – 90 & 97 – 122 )
- Digits ( 48 – 57 )
- Remaining are Special Character ( !, @, #, $, * …..)
Working
- User gives an input
- Input is stored in a char type variable say val.
- val is converted from char to int .
- The ASCII value of Character is Obtained
C code
Run //C++ program to calculate ASCII value of Character #include <iostream> using namespace std; //main program int main() { char val='z'; //printing the ASCII value of input //through typecasting cout<<"The ASCII value of "<<val<<" is "<<(int)val; return 0; }Output
The ASCII value of z is 122 Related Pages Juggling algorithm for array rotation Balanced Parenthesis ProblemToggle each character in a string
Count the number of vowels
Length of the string without using strlen() function
Prime Course Trailer
Related Banners
Get PrepInsta Prime & get Access to all 200+ courses offered by PrepInsta in One Subscription
Get PrimeFor similar question click on given button.
Top 100 Questions
Login/Signup to comment
×
30+ Companies are Hiring
Get Hiring Updates right in your inbox from PrepInsta
Select your Passing out Year 2022 2023 2024 2025 2026 2027 2028 2029 Others Get Hiring UpdatesTag » How To Get Ascii Value Of Char In C++
-
Get ASCII Value Of Char In C++ | Delft Stack
-
C++ Program To Find ASCII Value Of A Character - Programiz
-
Program To Print ASCII Value Of A Character - GeeksforGeeks
-
C++ Program To Print ASCII Value Of All Characters In The String
-
How To Convert An ASCII Char To Its ASCII Int Value? - Stack Overflow
-
Convert ASCII To Char In C++ - Java2Blog
-
ASCII Chart
-
How Do You Find The ASCII Value Of A Character? - MakeUseOf
-
C++ Program To Find ASCII Value Of A Character - Tutorialspoint
-
Print Character Through ASCII Value Using Cout In C++ - IncludeHelp
-
C++ Program To Find ASCII Value Of Character - Learn ETutorials
-
Program To Print ASCII Value Of A Character - STechies
-
ASCII Character Set
-
Ascii Value Of A Char In Cpp Code Example - Grepper