Question: import java.util.Scanner; public class LabProgram { public static void main ( String [ ] args ) { int a , b , c; Scanner sc

import java.util.Scanner;
public class LabProgram {
public static void main(String[] args){
int a, b, c;
Scanner sc = new Scanner(System.in);
System.out.print("First number: ");
a = sc.nextInt();
System.out.print("Second number: ");
b = sc.nextInt();
System.out.print("Third number: ");
c = sc.nextInt();
if (a == b && b == c){
System.out.println("All numbers are equal: "+ a);
} else {
int max = a;
if (b > max){
max = b;
}
if (c > max){
max = c;
}
System.out.println("Largest number: "+ max);
}
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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!