Question: Convert C to Mips assembly // c program #include #include #define MAX_SIZE 40 // Maximum string size declaration // Function declaration for removing the all

Convert C to Mips assembly

// c program #include #include #define MAX_SIZE 40 // Maximum string size declaration

// Function declaration for removing the all occurance of a given character void MIPS (char *, const char);

int main() { char str[MAX_SIZE]; //string declaration char charToRemove; // character declarction for removal form string

// getting string from user input printf("Enter your string: "); gets(str);

//Infinite loop for removing character from the given string until there is new line character has been inputed by the user for(; ;){ printf("Enter a character: "); charToRemove = getchar(); if(charToRemove == "10"){ return 1; break; } else{ MIPS (str, charToRemove); printf("String after removing '%c': %s ", charToRemove, str); } } return 0; }

// Function defination to remove all occurrences of a character from the given string.

void MIPS (char * str, const char toRemove) { int i, j; int length = strlen(str);

for(i=0; i

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!