What is wrong with the following code fragment? Rewrite it so that it produces correct output.
I'm new to programming and I'm not very good with logic.
Code:
if (total == MAX)
if (total < sum)
System.out.println("total == MAX and is < sum.");
else
System.out.println("total is not equal to MAX");
I'm new to programming and I'm not very good with logic.

