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
{
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
Get step-by-step solutions from verified subject matter experts
