Determining the uppercase and lowercase vowels.

Using Visual Studio 2015.



=========================================================================

#include<iostream>
using namespace std;
#include<conio.h>

void main()
{

char input;

cout<<"Input=";

cin>>input;

if (input == 'a' || input == 'e' || input == 'i' || input == 'o' || input == 'u')
{

cout<<"Lowercase Vowel";
}

else if (input == 'A' || input == 'E' || input == 'I' || input == 'O' || input == 'U')
{

cout<<"Uppercase vowel";
}

else
{

cout<<"Invalid input";
}

_getche();
}

=========================================================================


This program is to determine a lowercase or an uppercase vowel from the user's given input. We used "using namespace std;" because in the Visual studio, the header file "iostream" cannot be used without it. We used 'if else if' statement to determine uppercase and lowercase vowels.
Beginner's should know that '||' used in the 'if else if' statement means 'or'. It means that if not this, then this.

Comments

Popular posts from this blog

Program to calculate the number of days from the beginning of the year to a date specified by the user through array in C++

Suppose you are given a square matrix of size n x n, write a program to determine if this is an identity matrix. 2D array

Program to calculate the sum of first 100 even numbers using while loop