Exercise: Uppercase the String

Write the code to solve the problem.

Question

Write code below to convert all the letters in the string variable province to uppercase letters.

Here is a sample input and the expected output:

Input: Quebec
Output: QUEBEC
Expected outcome

If you’re unsure how to do this, click the “Show Hint” button.

Show Hint
Explanation

Exercise: Uppercase the String

Write the code to solve the problem.

Question

Write code below to convert all the letters in the string variable province to uppercase letters.

Here is a sample input and the expected output:

Input: Quebec
Output: QUEBEC
Expected outcome

If you’re unsure how to do this, click the “Show Hint” button.

Show Hint
Explanation
C
#include <stdio.h>
char * toUpperCase(char * province)
{
// Write your code here by modifying the province variable itself
// or save your uppercase string in a new variable of type char *
return province;
}
int main(void)
{
char province[] = "Ontario";
toUpperCase(province);
printf("Uppercase: %s\n", province);
return 0;
}