Sunday, 10 January 2021

C++ Program to Check Whether a character is Vowel or Consonant.

 //C++ Program to accept a letter and check Whether a character is Vowel or Consonant.

#include<iostream>

using namespace std;

main()

{

    char ch;

    cout<<"Enter a Character to check whether it is a vowel or a Constant\n";

    cin>>ch;

    if(ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u')

    cout<<ch<<" is a Vowel.";

    else 

    cout<<ch<<" is a Constant.";

}

No comments:

Post a Comment

Java Program to count the total number of characters in a string

 //Java Program to count the total number of characters in a string import java.util.*; public class CountChars {     public static void mai...