问题:
- write a program that inputs a character and passes it to function 'ulcase',
which uses the ASCII values to determine whether the given character is in
uppercase or lowercase
- The function should take a character argument and return 1(true) if it is uppercase
and 0(false) otherwise
#include<stdio.h>
#include<stdlib.h>
int ulcase(char character);
int main(void) {
char character;
printf("Enter the character:");
scanf_s("%c", &character);
printf("%c: %s\n", character, ulcase(character) ? "Uppercase" : "Lowercase");
system("pause");
return 0;
}
int ulcase(char character) {
return('A' <= character && character <= 'Z') ? 1 : 0;
}