lucproblem003.c (1221B)
1 /* 2 * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 3 * Repo: https://github.com/notamitgamer/bsc 4 * License: MIT 5 */ 6 7 /* If a character is entered through the keyboard, Write a program 8 to determine whether the character is a capital letter, a small case letter, 9 a digit or a speacial symbol. 10 The following table shows the range of ASCII values for various characters : 11 Characters ASCII Values 12 A - Z 65 - 90 13 a - z 97 - 122 14 0 - 9 48 - 57 15 special symbols 0 - 47, 58 - 64, 91 - 96, 123 - 127 16 */ 17 /* Let Us C, Chap - 4, Page - 65, Problem 4.2 */ 18 19 #include <stdio.h> 20 int main() 21 { 22 char inp; 23 printf("Enter one character : "); 24 scanf(" %c", &inp); 25 if (inp >= 64 && inp <= 90) 26 printf("\nInput '%c' is a CAPITAL LETTER.", inp); 27 if (inp >= 97 && inp <= 122) 28 printf("\nInput '%c' is a SMALL CASE LETTER.", inp); 29 if (inp >= 48 && inp <= 57) 30 printf("\nInput '%c' is a DIGIT.", inp); 31 if (inp >= 0 && inp <= 47 || inp >= 58 && inp <= 64 32 || inp >= 91 && inp <= 96 || inp >= 123 && inp <= 127) 33 printf("\nInput '%c' is a SPECIAL SYMBOL.", inp); 34 return 0; 35 }