Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- //Ex6
- int Lower(char sym){
- if(sym >= 'a' && sym <= 'z'){
- printf("Yes");
- return 0;
- }else{
- printf("No");
- return 0;
- }
- }
- //Ex7
- int Upper(char sym){
- if(sym >= 'A' && sym <= 'Z'){
- printf("Yes");
- return 0;
- }else{
- printf("No");
- return 0;
- }
- }
- //Ex8
- int Letter(char sym){
- if(sym >= 'A' && sym <= 'Z')
- {
- printf("Upper");
- return 0;
- }
- else
- {
- printf("Lower");
- return 0;
- }
- }
- //Ex9
- int DigOrLet(char sym){
- if(sym >= '0' && sym <= '9')
- {
- printf("Digit");
- return 0;
- }
- else
- {
- printf("Letter");
- return 0;
- }
- }
- int main(){
- printf("------------------Exercise6------------------\n");
- printf("%c\n", Lower('6'));
- printf("------------------Exercise7------------------\n");
- printf("%c\n", Upper('V'));
- printf("------------------Exercise8------------------\n");
- printf("%c\n", Letter('a'));
- printf("------------------Exercise9------------------\n");
- printf("%c\n", DigOrLet('5'));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement