Given the following function definition: int myFn2(char str1[], char str2[]) {in
ID: 2082095 • Letter: G
Question
Given the following function definition: int myFn2(char str1[], char str2[]) {int I = 0; while (str1[i] t = 0 && str2[i] 1 =/0') {if (str1 [i] I = str2[i]_ {return 0;} ++I;} if (str1[i] == str2[i] return 1; else return 0;} what will the following function calls return? myFn2("bee", "cat") myFn2("owl", "owl") myFn2("no", "not") what would be a more meaningful name for the function myFn? What is the purpose of the last if/else statement in the function? What is the output of the following code? Void myFn3(int array[], int n) int I; for (I = 0; IExplanation / Answer
3(a). myFan2("bee","cat") function will return 0.
myFan2("owl", "owl") function will return 1.
myFan2("no","not") function will return 0.
3(b) As the function is comparing two strings the more appropriate name could be string_comparision.
3(c). The purpose of the last statement is to compare the strings whether they are equal or not.
4. output : 12, -6, 2, 18, -25, 49
13, -5, 3, 19, -24, 50
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.