codescracker
c++

C++ Character Set



« Previous Tutorial Next Tutorial »

Character set is a set of valid characters that a language can recognise. A character represents any letter, digits, or any other sign.

C++ has the following character set :

C++ Character Set Example

Following C++ program gives you an idea about using of character set in C++ programming language :

/* C++ Character Set Example */

#include<iostream.h>
#include<conio.h>
void main()
{
   clrscr();
   char letter, digit, special, white;

   cout<<"Enter a Letter : ";
   cin>>letter;
   cout<<"You entered a letter '"<<letter<<"'"<<"\n";

   cout<<"Enter a Digit : ";
   cin>>digit;
   cout<<"You entered a digit '"<<digit<<"'"<<"\n";

   cout<<"Enter a special character : ";
   cin>>special;
   cout<<"You entered a special character '"<<special<<"'"<<"\n";

   cout<<"A horizontal(\t) tab";

   getch();
}

When the above C++ program is compile and executed, it will produce the following output:

C++ character set

More Example

Here are some C++ example programs listed, that you can go for:

C++ Online Test


« Previous Tutorial Next Tutorial »



© Copyright 2021. All Rights Reserved.

CodesCracker