Syvum Home Page

Home > Quiz Games > C++ Programming > Print Preview

C++ Programming : Program 39-A

Program to enter a character and output its ASCII code


#include <iostream.h>
#include <conio.h>

void main()
char charac;
cout << "Enter the character : " << endl;
int num1=charac;
cout << "The ASCII code for " << charac << " is " << num1 << "." << endl;

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.


The ASCII code for a is 97.

Index of C++ Programs

45 more pages in C++ Programming

Contact Info © 1999-2023 Syvum Technologies Inc. Privacy Policy Disclaimer and Copyright