Upload files to "OOP/Java/Lab/Week2"

This commit is contained in:
aadit 2024-08-05 01:04:41 +05:30
parent 730413c501
commit 40f695b27c
5 changed files with 129 additions and 0 deletions

View file

@ -0,0 +1,23 @@
import java.util.Scanner;
public class Ternary {
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
System.out.println("Enter the first number: ");
int a = sc.nextInt();
System.out.println("Enter the second number: ");
int b = sc.nextInt();
System.out.println("Enter the third number: ");
int c = sc.nextInt();
int largest = (a>b)?((b>c)?a:c):((b>c)?b:c);
System.out.println("The largest number is: "+largest);
}
}