0

Write a program that accepts three intergers from user and display maximum interger?

I need answer guys

21st Mar 2017, 5:51 PM
DIXON CYPRIAN
DIXON CYPRIAN - avatar
1 Antwort
+ 1
import java.util.Scanner; public class Main { public static void main(String[] args) { int firstNum, secondNum, thirdNum ; Scanner scanner = new Scanner(System.in); System.out.print("Enter a number: "); firstNum=scanner.nextInt(); System.out.print("Enter second number: "); secondNum=scanner.nextInt() ; System.out.print("Enter third number: "); thirdNum=scanner.nextInt() ; if(firstNum >secondNum) System.out.println(firstNum+ " is largest") ; else if (secondNum>thirdNum) System.out.println(secondNum+" is largest") ; else System.out.println(thirdNum+" is largest ") ; } }
21st Mar 2017, 6:20 PM
Bhabesh Gogoi
Bhabesh Gogoi - avatar