Write a program which will scan the values in an array named array anc leave the smallest value in register $v0. Assume the length of the array is not 0. Assume the end of the array is marked by the label end as in the preceding exercise. Hint: Use the first value in the array as a temporary result, then replace it if you find a value which is smaller. .data .word 25, 63, -45, 0, 12, -25, 66, 99 array: end: word 0 # Marks the end of the array.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter7: Arrays
Section: Chapter Questions
Problem 6PP: (Numerical) a. Define an array with a maximum of 20 integer values, and fill the array with numbers...
icon
Related questions
Question
3. Write a program which will scan the values in an array named array and
leave the smallest value in register $v0. Assume the length of the array is
not 0. Assume the end of the array is marked by the label end as in the
preceding exercise.
Hint: Use the first value in the array as a temporary result, then replace
it if you find a value which is smaller.
.data
.word 25, 63, -45,
array:
end:
12, -25, 66, 99
# Marks the end of the array.
.word 0
Transcribed Image Text:3. Write a program which will scan the values in an array named array and leave the smallest value in register $v0. Assume the length of the array is not 0. Assume the end of the array is marked by the label end as in the preceding exercise. Hint: Use the first value in the array as a temporary result, then replace it if you find a value which is smaller. .data .word 25, 63, -45, array: end: 12, -25, 66, 99 # Marks the end of the array. .word 0
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning