I don’t know how to use datatype char properly.
How to give the command of lowercase and uppercase??
the lectures till now didn’t included this thing.
Plz help me with this
Using char data type
hi @sakshamngplsn_8a4528baa287a8ff
its a very simple ques… u just have to check if character is lowercase or uppercase…
refer my code -->
#include <iostream>
#include <string>
using namespace std;
int main() {
char ch;
cin>>ch;
if(ch>='a' and ch<='z'){
cout<<"lowercase";
}
else if(ch>='A' and ch<='Z'){
cout<<"UPPERCASE";
}
else{
cout<<"Invalid";
}
}
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.