Site icon T4Tutorials.com

Write a C program to check whether a character is an uppercase or lowercase

Write a C++ program to check whether a character is an uppercase or lowercase alphabet by using the switch statement.

Flowchart of the program to check a character is lowercase or an uppercase

C++ program to check whether a character is lowercase or an uppercase

#include<iostream>
using namespace std;
int main()
{
	char ch;
	cout<<" ENTER a character"<<endl;
	cin>>ch;
	switch(ch)
	{
		case  'A'...'Z':
			cout<<"character "<<ch<<" is uppercase character";
			break;
			case 'a'...'z':
				cout<<"character "<<ch<<" is lowercase character";
				break;
				default:
					cout<<"invalid character";
	}
}

Output

ENTER a character

R character R is upper case character

SFT (Shamil’s Flow Table )

Are you interested to Read about SFT(Shamil’s Flow Table)?

Read More Similar Programs 

  1. program to check  character is small, capital, or a special character
  2. program to check character is an alphabet, digit or special character
  3. program to check whether a character is uppercase or lowercase alphabet, Using if else.
  4. program that checks whether the character is an alphabet or not
Exit mobile version