Thursday, June 3, 2021

check you entered a char or not (POP) (101)

#include<iostream>

using namespace std;

int main()

{

char ch;

cout<<"please enter any character:"<<endl;

cin>>ch;

if(ch>'a'&&ch<'z'||ch>'A'&&ch<'Z')

{

cout<<"this is a character";

}

else

{

cout<<"this is not a character";

}

return 0;

} 

No comments:

Post a Comment