Tuesday 24 June 2014

C++ program to check whether a character is uppercase or lowercase


Here is a C++ program to check whether a character is uppercase or lowercase


 SOURCE CODE OUTPUT
#include<iostream>
#include<string.h>
using namespace std;
int main()
{
    char temp;
    cout<<"Enter the character ";
    cin>>temp;
    if(temp>=65&&temp<=90)
       cout<<"Character is in uppercase";
    else if(temp>=97&&temp<=222)
       cout<<"Character is in Lowercase";
    else
        cout<<"Given character is not alphabetic character ";
    return 0;
}

Any questions regarding to program please write in comments.

No comments:

Post a Comment