Computer Science, asked by ankitmaiti11, 14 hours ago

Write a program in Java to enterthree numbers as argument. Find and print the largest number.​

Answers

Answered by ethicalhacker7049
1

Answer:import java.util.Scanner;  

public class LargestNumberExample1  

{  

public static void main(String[] args)  

{  

int a, b, c, largest, temp;  

//object of the Scanner class  

Scanner sc = new Scanner(System.in);  

//reading input from the user  

System.out.println("Enter the first number:");  

a = sc.nextInt();  

System.out.println("Enter the second number:");  

b = sc.nextInt();  

System.out.println("Enter the third number:");  

c = sc.nextInt();  

//comparing a and b and storing the largest number in a temp variable  

temp=a>b?a:b;  

//comparing the temp variable with c and storing the result in the variable  

largest=c>temp?c:temp;  

//prints the largest number  

System.out.println("The largest number is: "+largest);  

}  

}  

Explanation:

Answered by vijaymanchanda03
0

Answer:

import java.util.Scanner;public class LargestNumberExample5.{public static void main(String args[]){int num1, num2, num3;System.out.println("Enter three integers: ");Scanner in = new Scanner(System.in);

Explanation:

pls mark me as brainliest

Similar questions