Question: Here is the code that i have: it is not fully working yet. #include #include #include void extract(char *s1, char *s2) { int i =

Here is the code that i have: it is not fully working yet.
#include
for(i; i
if( s1[i] == 'e' && s1[i+1] == 'd' && s1[i+2] =='u') { endIndex = i+2; } }
if( startIndex == 0 && endIndex == 0) { printf("Web address starting with www. and ending with .edu not found "); } else { for (startIndex; startIndex
s2[j] = s1[startIndex]; j++; } }
s2[j] = '\0';
} int main() // main should return int { char input[1000]; char output[1000];
printf("Input: "); scanf("%s", input);
extract(input, output); printf("Output: "); printf("%s", output); }
Can you try to make it work? try inputs "http://www.npr.org" and it should say web address starting with www. and ending with .edu not found. I will make sure to thumbs up! please modify MY code, i think it is almost working but i dont know what is wrong. please try to give screenshot of output too Thank you :)
1. (60 points Write a program to extract Web addresses starting with www. and ending with edu. The program displays Web address contained in the input entered by the user. If the input does not contain a web address that starts with www. and ends with edu, the program should display a message that indicates such a web address cannot be found. Input http://www.usf.edu/admission Output www.usf f.edu Input https://www.facebook.com/ Output Web address starting with www and ending with edu not found Your program should include the following function: void extract (char sl, char *s2); The function expects s 1 to point to a string containing the input as a string and stores the output to the string pointed by s2. 1) Name your program extract .c 2) Assume input is no longer than 1000 characters. Assume the input contains no more than one qualifying web address. 3) The extract function should use pointer arithmetic (instead of array subscripting). In other words, eliminate the loop index variables and all use of the operator in the function. 4) To read a line of text, use the read line function (the pointer version) in the lecture notes. Please make sure it compiles with gcc-Wall. And show working output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
