Question: 3. (15 pts) Complete the code below to print the second to last character of the string mystring. char mystring[200; scanf(%s, mystring); /* initialize from
3. (15 pts) Complete the code below to print the second to last character of the string mystring. char mystring[200; scanf("%s", mystring); /* initialize from standard input */ (10 pts) Declare (not define) a function called longer that takes two strings as parameters (without using array notation) and returns the longer string. 4. 5. (15 pts) Fix the error in the following fragment. Explain why. void makeAvailable(char *p) strcpy(p, "Available": char status "Unavailable" char value; printf"Should make available? y: "; scanf("%c", &value); if (valueY) makeAvailable(status); 6. (25 pts) Write a function removeSpaces that remove all space characters from a given string s1 and stores the result in a second string s2. Your function should have the following prototype: void removeSpaces (char *s1, char 's2)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
