Question: What does this code do? Explain. Then change this code so that it removes something else you define. (3 questions) #include int main() { char

What does this code do? Explain. Then change this code so that it removes something else you define. (3 questions) #include int main()

{

char line[150];

int i, j;

printf("Enter a string: ");

scanf("%s", &line);

//gets(line);

for(i = 0; line[i] != '\0'; ++i)

{

while (!( (line[i] >= 'a' && line[i] <= 'z') || (line[i] >= 'A' && line[i] <= 'Z') || line[i] == '\0') )

{

for(j = i; line[j] != '\0'; ++j)

{

line[j] = line[j+1];

}

line[j] = '\0';

}

}

printf("The revised string rom what was entered is now: %s ", line);

//puts(line);

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!