Question: Find the output import java.util.*; public class DebugFive4 { public static void main (String args[]) { Scanner input = new Scanner(System.in); int one, two,

Find the output

 

import java.util.*;

public class DebugFive4

{

public static void main (String args[])

{

Scanner input = new Scanner(System.in);

int one, two, three, four;

String str, output;

System.out.println("Enter an integer");

str = input.next();

one = Integer.parseInt(str);

System.out.println("Enter an integer");

str = input.next();

two = Integer.parseInt(str);

System.out.println("Enter an integer");

str = input.next();

three = Integer.parseInt(str);

System.out.println("Enter an integer");

str = input.next();

four = Integer.parseInt(str);

if(one > two && one > three && one > four){

output = "Highest is " + four;

}

else

if(two > one && two > three && two > four){

output = "Highest is " + three;

}

else

if(three > one && three > two && three > four)

{

output = "Highest is " + three;

}

else

{

output = "Highest is " + four;

}

System.out.println(output);

input.close();


}

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Answer Lets go through the code and determine the output The ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!