Write a program to determine whether the entered character is in an uppercase or lowercase, or is an invalid character.
Print.
1 for uppecase
0 for lowercase
-1
for any other character (special characters or others).
#include<iostream>
using namespace std;
int main()
{
char ch;
cin >> ch;
if(ch<=90 && ch>=65)
{
cout<<1<<endl;
}
else if(ch<=122 && ch>=97)
{
cout<<0<<endl;
}else
cout<<-1<<endl;
}
0 comments:
Post a Comment