how to code a program which accepts a list of numbers and calculate the maximum of the list of numbers using two function

JeckeL

Distinguished
Jul 19, 2009
224
1
18,910
41
You didn't state what language it should be written in... I won't do your homework for you but here's a hint:

Create a variable to store the high number, then put the first number in the list/array in that variable, then check each number against the high number using an if statement:

If (array[currentNumber] > highNumber) {

highNumber = array[currentNumber];

}
 

JeckeL

Distinguished
Jul 19, 2009
224
1
18,910
41
You didn't state what language it should be written in... I won't do your homework for you but here's a hint:

Create a variable to store the high number, then put the first number in the list/array in that variable, then check each number against the high number using an if statement:

If (array[currentNumber] > highNumber) {

highNumber = array[currentNumber];

}
 
Thread starter Similar threads Forum Replies Date
D Android Smartphones 2
K Android Smartphones 3
Gblnos Android Smartphones 4
Manzy Android Smartphones 3
L Android Smartphones 4
S Android Smartphones 4
A Android Smartphones 1
F Android Smartphones 1
M Android Smartphones 1
C Android Smartphones 1
Y Android Smartphones 1
K Android Smartphones 1
R Android Smartphones 1
K Android Smartphones 1
V Android Smartphones 1
G Android Smartphones 1
B Android Smartphones 1
T Android Smartphones 7
D Android Smartphones 1
C Android Smartphones 4

ASK THE COMMUNITY