Here is a C++ program to check whether a character is uppercase or lowercase
SOURCE CODE OUTPUT
#include<iostream>
#include<string.h>
using namespace std;
int main()
{
char temp;
cout<<"Enter the character ";
cin>>temp;
if(temp>=65&&temp<=90)
cout<<"Character is in uppercase";
else if(temp>=97&&temp<=222)
cout<<"Character is in Lowercase";
else
cout<<"Given character is not alphabetic character ";
return 0;
}
#include<string.h>
using namespace std;
int main()
{
char temp;
cout<<"Enter the character ";
cin>>temp;
if(temp>=65&&temp<=90)
cout<<"Character is in uppercase";
else if(temp>=97&&temp<=222)
cout<<"Character is in Lowercase";
else
cout<<"Given character is not alphabetic character ";
return 0;
}
Any questions regarding to program please write in comments.
No comments:
Post a Comment