This blog is under construction

Saturday, 17 March 2012

toupper example in C

Header file:

    int toupper (int input)

    converts the given input to lower case if possible

Return Value:
    returns upper case of "input", if "input" is in lower case.  Otherwise "input" is returned unchanged.

toupper function C example:

  int main() {
        char c;
        printf("Enter your input:");
        c = getchar();
        printf("Result for the given input: %c\n", toupper(c));
        return 0;

  jp@jp-VirtualBox:~/cpgms$ ./a.out
  Enter your input:a
  Result for the given input: A

No comments:

Post a Comment