9:29 pm - Thursday July 19, 2018

Java Example Program for bigest of given three numbers

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044

/**
*@author:candidjava.com
*@description:bigest of given three numbers
*/

import java.io.*;

public class BiggestThree // creation of class
{
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.println("enter the value of i,j and k"); // to print in
// output screen
int i = Integer.parseInt(br.readLine()); // get the value of i at run
// time
int j = Integer.parseInt(br.readLine()); // get the value of j at run
// time
int k = Integer.parseInt(br.readLine()); // get the value of k at run
// time
if (i > j && i > k) // use the condition to know i is bigger than j and
// k
System.out.println(i + " is greater");
else if (j > i && j > k) // using the condition to know j is bigger than
// i and k
System.out.println(j + " is greater");
else
System.out.println(k + " is greater");
}
}

Output:

enter the value of i,j and k
5
8
1
8 is greater

Filed in: Z-A All Java Codes

Comments are closed.