Lecture# 20 Find Vowel or Consonant using if-else| C++ Programming Tutorials in Urdu

Write a program to find vowel or constant using if-else statement

include"iostream"
using namespace std;
main()
{
char ch;
cout<<"Enter choice (+,-,*,/) = ";
cin>>ch;
if(ch == 'a' || ch == 'A')
{
cout<<"It is vowel";
}
else if(ch == 'e' || ch == 'E')
{
cout<<"It is vowel";
}
else if(ch == 'o' || ch == 'O')
{
cout<<"It is vowel";
}
else if(ch == 'i' || ch == 'I')
{
cout<<"It is vowel";
}
else if(ch == 'u' || ch == 'U')
{
cout<<"It is vowel";
}
else
cout<<"It is a constant";
}

Watch video for more information

Leave a Reply