c program to check whether a character is uppercase or lowercase alphabet
#includeOutputint main() { char c; // enter character value printf("Enter u to display uppercase alphabets.\n"); // U for uppcase printf("Enter l to display lowercase alphabets. \n"); // I for lowercase scanf("%c", &c); // storing values if (c == 'U' || c == 'u') { for (c = 'A'; c <= 'Z'; ++c) printf("%c ", c); } else if (c == 'L' || c == 'l') { for (c = 'a'; c <= 'z'; ++c) printf("%c ", c); } else { printf("Error! You entered an invalid character."); } return 0; }
Enter u to display uppercase alphabets Enter l to display lowercase alphabets = I a b c d e f g h i j k l m n o p q r s t u v w x y zHappy Coding
Thanks for visiting my Blog.
Have any problem, feel free to contact us via Email : uoslondy@gmail.com
Have a good day!
0 comments:
Post a Comment