Java Example Program to find the Largest among 3 Numbers Entered by the user

preview_player
Показать описание
in this video you will learn to write an example program to find the largest among 3 numbers entered by the user using if else conditional statements in Java programming language.

Watch the video Find the Largest among 3 Numbers by using ternary operator

our Social Media Pages

Our Website

#JavaProgramming #ExampleProgram
Рекомендации по теме
Комментарии
Автор

Wow this straight forward and easy to follow

chestwoodnelber
Автор

find the largest n such that n cubed is less than a positive integer entered by the user. User a while loop to find the largest integer n

robertkakari
Автор

Why did you use printf instead of println in last line

priyankak
Автор

import java.util.Scanner;
class Maxvalue {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter your 1st Number : ");
int n1 = scan.nextInt();
System.out.println("Enter your 2nd Number : ");
int n2 = scan.nextInt();
System.out.println("Enter your 3rd Number : ");
int n3 = scan.nextInt();
if (n1>n2 && n1>n3){
System.out.println(n1+" is largest number");
}
else if(n2>n1 && n2 > n3 ){
System.out.println(n2+" is lagest Number");
}
else{
System.out.println(n3+" is lagest Number");
}
}
}

shehan