how to find maximum and minimum number using array
#include<iostream>using namespace std;
main(){
double v[5];
for (int i=0;i<5;i++)
{
cout<<"enter the value of interger ";
cin>>v[i];
}
double max = v[0];
double min = v[0];
for (int i=1;i<5;i++)
{
if (v[i]< min)
{
min=v[i];
}
if (v[i]>max)
{
max=v[i];
}
}
cout<<"maximun number is "<<max<<endl;
cout<<"minimum number is "<<min<<endl;
}
0 on: "how to find maximum and minimum number using array"