AnTonia K.

asked • 07/09/23

I am in dire need in assistance with solving and correcting these syntax and logic errors

public static void main(String[] args) {
int[] num = { 7, 2, 6, 4, 12, 6, 1, 8, 49, 3 };
int lowest = num[0];
int highest = num[0];
for (int i = 0; i < num.length; i++) {
if (num[i] < lowest) {
lowest = num[i];
} else {
highest = num[i];
}
}
}

1 Expert Answer

By:

Mihir P. answered • 07/10/23

Tutor
New to Wyzant

Computer Science Tutor for High School and College Students

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.