about-text

SoftOSet is the most remarkable programming site. SoftOSet provides the fresh conceptual and professional programs, articles, books, and other interesting and technical writings. SoftOSet is the most reliable programming site to learn the programs and the basics of the popular programming languages. SoftOSet is the hub of the informative and research based articles.

Character to ASCII conversion in C Plus Plus Program


Character to ascii conversion program in C++


ASCII

ASCII stands for American Standard Code for Information Interchange. These are some unique codes assigned to every character, digits and special symbols.

Our task is to find out the ASCII number associated with the each character.

Scenario

We will develop a program which will take the character form user and provide them the ASCII code.

 

So Let’s start

 

 Character to ASCII conversion in C++ Program

Code

#include<iostream>

using namespace std;

int main()

{

            do{

                        cout<<"\nEnter Character :";

            char a;

            cin>>a;

            cout<<"Ascii Value ="<<static_cast<int>(a);

}

while('a');

            return 0;

}

We have make use of the built in static_cast to print the ASCII code.

 

 

Character to ASCII conversion in C++ Program

Output

 

 

C++ program to convert characters to ascii value

And here we have some sample to show you how this program behaves with the user.

 

 

 

^^^^^^^^^^^^^^^^^^Thanks You^^^^^^^^^^^^^^^^^^^^^^^^^^^

 

 


Post a Comment

Feel Free to Comment Us

Previous Post Next Post

Recents