0

Explain the use of function toupper() with an example code?

Shathana. S.R. Answered question May 26, 2023
User Avatar

Toupper() function is used to convert the value to uppercase when it used with characters.

Code:

#include
#include
int main()
{
char c;

c = ‘a’;
printf(“%c -> %c”, c, toupper(c));

c = ‘A’;
printf(“n%c -> %c”, c, toupper(c));

c = ‘9’;
printf(“n%c -> %c”, c, toupper(c));
return 0;
}