The function returns the corresponding uppercase letter if one exists and if islower(c); otherwise, it returns c.
Return Value
The function returns the corresponding uppercase letter if one exists and if islower(c); otherwise, it returns c.
Example
#include <stdio.h>
int main() {
printf( "Upper case of a is %c\n", toupper('a'));
printf( "Upper case of 9 is %c\n", toupper('9'));
printf( "Upper case of g is %c\n", toupper('g'));
return 0;
}
It will proiduce following result:
Upper case of a is A
Upper case of 9 is 9
Upper case of g is G