Write a program to check a character is in upper case or lower case

A character is taken from user and is checked if it is in UPPER CASE or lower case..


Select To use this code as it is.. select and copy paste this code into code.cpp file :)



  1. #include<iostream.h>
  2. #include<conio.h>
  3. void main()
  4. {
  5. clrscr();
  6. char x;
  7. cout<<"Please enter a character: ";
  8. cin>>x;
  9. //Coding by: Snehil Khanor
  10. //http://WapCPP.blogspot.com
  11. if(x>='A'&&x<='Z')
  12. cout<<x<<" is in UPPER CASE:)";
  13. else
  14. cout<<x<<" is in lower case :)";
  15. getch();
  16. }

Check out this stream