Write a program in the C ++ language that executes the following application
1- Define an array consisting of 10 values
2- The user is allowed to enter 10 values
3- Prints the lowest value in the array
// STAY HOME STAY SAFE
#include<iostream>
using namespace std;
int main()
{
// declare an array of 10 values
int arr[10];
// input the values in the array
cout<<"Enter the values of the array...\n";
for(int i=0;i<10;i++)
{
cin>>arr[i];
}
// find the minimum element in the array
int m=arr[0];
for(int i=0;i<10;i++)
{
if(m>arr[i])
{
m=arr[i];
}
}
// display the minimum element of the array
cout<<"The minimum value present in the array is
"<<m<<"\n";
return 0;
}
Get Answers For Free
Most questions answered within 1 hours.