C++ Programming

C++ – Input Character and Display Vowel or Not

Input Character and Display Vowel or Not

Write a program that prints the ASCII code of the input character (both upper case and lower case) and displays whether the character is a vowel or not.

e.g. if ‘A’ is inputted then the output should be 65 and should display ‘vowel’.

Source Code

void main()
    int num;
    char ascii;
    cout<<"Enter character:";
    cout<<"it ascii value is:"<<(int)ascii<<endl;
    cout<<"It is vowel";
      cout<<"Not Vowel";


Enter a character: a
It ASCII value is: 97
It is vowel


About Author

Tutsmaster.org provides tutorials related to tech and programmings. We are also setting up a community for the users and students.

You may also like

program to find leap year
C++ Programming

C++ Program to Find Leap Year by Using Function

  • March 3, 2016
Write a program to find if the inputted year is a leap year or not by using the concept of