Created
March 4, 2016 04:26
-
-
Save w3farid/956b77f31f6cde485566 to your computer and use it in GitHub Desktop.
Calculate the largest number among the three number?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class LargestNumberAmongThreeNumber { | |
public static void main(String[] args) { | |
Scanner s=new Scanner(System.in); | |
int a,b,c,d; | |
System.out.println("Enter all three numbers: "); | |
a=s.nextInt(); | |
b=s.nextInt(); | |
c=s.nextInt(); | |
d=c>(a>b?a:b)?c:((a>b)?a:b); | |
System.out.println("Largest Number Is : "+d); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment