This blog is under construction

Saturday, 17 March 2012

isupper example in C

Header file:
    ctype.h

Synopsis:
    int isupper (int c)   

Description:
    Checks whether the given input is an uppercase character or not.

Return Value:
    TRUE(non-zero) on success
    0 on failure


isupper function C example


  #include<stdio.h>
  #include<ctype.h>
  int main() {
        char a;
        printf("Enter a character:");
        a = getchar();
        if(isupper(a))
                printf("The given character is in upper case\n");
        else
                printf("The given character is not in upper case\n");
        printf("Return value from isupper:%d\n", isupper(a));
        return 0;
  }



  Output:
  Enter a character:A
  The given character is in upper case
  Return value from isupper:256

No comments:

Post a Comment