Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using Mips Assembly find the maximum and minimum values of an array You can use this code to help you translate from C++ 0.#include using
Using Mips Assembly find the maximum and minimum values of an array You can use this code to help you translate from C++ 0.#include
-
using namespace std;
-
int main ()
-
{
-
int arr[10], n, i, max, min;
-
cout << "Enter the size of the array : ";
-
cin >> n;
-
cout << "Enter the elements of the array : ";
-
for (i = 0; i < n; i++)
-
cin >> arr[i];
-
max = arr[0];
-
for (i = 0; i < n; i++)
-
{
-
if (max < arr[i])
-
max = arr[i];
-
}
-
min = arr[0];
-
for (i = 0; i < n; i++)
-
{
-
if (min > arr[i])
-
min = arr[i];
-
}
-
cout << "Largest element : " << max;
-
cout << "Smallest element : " << min;
-
return 0;
-
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started