Question: Complete CapVowels(), which takes a string as a parameter and returns a new string containing the string parameter with the first occurrence of each of

Complete CapVowels(), which takes a string as a parameter and returns a new string containing the string parameter with the first occurrence of each of the five English vowels (a, e, i, o, and u) capitalized. Hint: Begin CapVowels() by copying the string parameter to a newly allocated string.

Ex: If the input is:

management

mAnagEment

#include #include #include

// Return a newly allocated copy of original // with the first occurrence of each vowel capitalized char* CapVowels(char* original) { /* Type your code here. */ }

int main(void) { char userCaption[50]; char* resultStr; scanf("%s", userCaption);

resultStr = CapVowels(userCaption);

printf("Original: %s ", userCaption); printf("Modified: %s ", resultStr); // Always free dynamically allocated memory when no longer needed free(resultStr); return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!