Thursday, June 3, 2021

c++ program check you enter char, num, or special char (POP) (105)

 #include<iostream>

using namespace std;

int main()

{

char ch;

cout<<"please enter any character:";

cin>>ch;

if(ch>='a'&&ch<='z')

{

cout<<"this is an elephabet";

}

else if(ch>='0'&&ch<='9')

{

cout<<"this is a number";

}

else

{

cout<<"this is a special character";

}

return 0;

}

No comments:

Post a Comment