Question: #include #include #define BUF_SIZE 128 void remove_newline(char *str) { int l = strlen(str); if (str[l-1] == ' ') { str[l-1] = 0; } } int

 #include #include #define BUF_SIZE 128 void remove_newline(char *str) { int l= strlen(str); if (str[l-1] == ' ') { str[l-1] = 0; }

#include #include

#define BUF_SIZE 128

void remove_newline(char *str) { int l = strlen(str); if (str[l-1] == ' ') { str[l-1] = 0; } }

int isvowel(char c) { switch (c) { case 'a': case 'A': case 'e': case 'E': case 'i': case 'I': case 'o': case 'O': case 'u': case 'U': return 1; } return 0; }

int main() { char str1[BUF_SIZE] = { 0 }; char str2[BUF_SIZE] = { 0 };

printf("Enter a string: "); fgets(str1, BUF_SIZE, stdin); remove_newline(str1);

printf("Enter another string: "); fgets(str2, BUF_SIZE, stdin); remove_newline(str2);

// Swap the vowels swap_vowels(str1, str2); printf("%s %s ", str1, str2);

return 0; }

The following code should swap the vowels between two input strings. Most of the setup code is complete, the remaining task is to create a function named 'swap_vowels which takes as input two pointers-to-char. The function should swap the vowels between two input strings. If the strings do not contain the same number of vowels, then only the corresponding vowels will be swapped (see example output). The function should return an integer indicating how many vowels were swapped. Modify the given code as requested. Example Output Enter a string: perseverance Enter another string: curiosity pursivorince cereesaty

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!