Write the program to accept a single character from a user. Check whether a character is a uppercase, lowercase, digits or special characters help with this please fast
Answers
Answer:
Explanation:
#include<bits/stdc++.h>
using namespace std;
void check(char ch)
{
if (ch >= 'A' && ch <= 'Z')
cout<< ch << " is an UpperCase character\n";
else if (ch >= 'a' && ch <= 'z')
cout<< ch << " is an LowerCase character\n";
else
cout<< ch << " is not an aplhabetic character\n";
}
// Driver Code
int main()
{
char ch;
// Get the character
ch = 'A';
// Check the character
check(ch);
// Get the character
ch = 'a';
// Check the character
check(ch);
// Get the character
ch = '0';
// Check the character
check(ch);
return 0;
}
// This code is contributed by Code_Mech