Hello friends, Welcome to your Techgsr.co blog. And today in this article we will learn about how to print character using ascii value in c++ .So let’s go to our topic
#include <iostream.h> #include <conio.h> void main() { clrscr(); char charac; cout << “Enter the character : ” << endl; cin>>charac; int num1=charac; cout << “The ASCII code for ” << charac << ” is ” << num1 << “.” << endl; getch(); }
This program takes in any character charac as a screen input from the user.
It then finds out its ASCII code and outputs it using the ‘cout’ command.
INPUT :
a
OUTPUT :
The ASCII code for a is 97.
Related Post:-
So I hope that you learn about the this program And if you have any more queries about progrmming ,web Devlopment ,tech,computer relegated then feel free to discuss your problem in the comment section.Thank you so much and come back for more updates about Techgsr.co .