+ 1
How do i create a program that outputs the maximum value of a range of values
2 Antworten
0
take an array of nos.
int main()
{
int a[10];
int max=a[0];
for(int i=1;i<10;i++){
if(max < a[i])
max = a[i];
}
cout<<max;
}
- 1
Well if it's a range like M..N(M to N) isn't N the largest number ?
Assuming that this range is not a range and is rather a list of numbers then,
use quicksort(Google it's C++ implementation) and display the last number in the array