Write a complete MIPS program that implements the same algorithm shown below (in C). To verify the output of the MIPS program, copy this C code and execute it. int main() char string[256]; int i=0; char *result = NULL; = NULL // NULL pointer is binary zero 1/ Obtain string from user, e.g. “Constantinople”, scanf(“%255s”, string); // Search string for letter ‘e’. // Result is pointer to first e (if it exists) // or NULL pointer if it does not exist while(string[i] != ’10’) { if(string[i] == ‘e’) { result = &string[i]; break; // exit from while loop early i++; if(result != NULL) { printf(“First match at address %dn”, result); printf(“The matching character is cn”, *result); else printf(“No match foundn”); The array of characters is an array of bytes, not words! The result pointer must be stored in memory when the program finishes. Show transcribed image text Write a complete MIPS program that implements the same algorithm shown below (in C). To verify the output of the MIPS program, copy this C code and execute it. int main() char string[256]; int i=0; char *result = NULL; = NULL // NULL pointer is binary zero 1/ Obtain string from user, e.g. “Constantinople”, scanf(“%255s”, string); // Search string for letter ‘e’. // Result is pointer to first e (if it exists) // or NULL pointer if it does not exist while(string[i] != ’10’) { if(string[i] == ‘e’) { result = &string[i]; break; // exit from while loop early i++; if(result != NULL) { printf(“First match at address %dn”, result); printf(“The matching character is cn”, *result); else printf(“No match foundn”); The array of characters is an array of bytes, not words! The result pointer must be stored in memory when the program finishes.
Expert Answer
Answer to Write a complete MIPS program that implements the same algorithm shown below (in C). To verify the output of the MIPS pr…