write a c++ program to find whether the given character is a digit ,alphabet or a number.
Home
/
Computer Science
/
write a c++ program to find whether the given character is a digit ,alphabet or a number
write a c++ program to find whether the given character is a digit ,alphabet or a number.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
int main ()
{
int a ;
cout<<"Enter a character";
cin>>a;
if( isdigit(a))
{
cout<<a<<"is a digit";
}
else if(isalpha(a) )
{
cout<<a<<"is a alphabet";
}
else
{
cout<<a<<"is a symbol";
}
return 0;
}