# CHECK WHICH NO IS GREATER IN 4 NO'S

AJAY CHAUDHARY
CHECK WHICH NO IS GREATER IN 4 NO'S
3 Answer(s)      6 years and 7 months ago
Posted in : Java Beginners

MAKE A PROGRAM TO CHECK WHICH NO. IS GREATER IN 4 NO'S IN JAVA ???

April 14, 2011 at 11:59 AM

```**class u
{
public static void main(String as[])
{
int a,b,c,d;
a=Integer.parseInt(as[0]);
b=Integer.parseInt(as[1]);
c=Integer.parseInt(as[2]);
d=Integer.parseInt(as[3]);
if(a>b)
{
if(a>c)
{
if(a>d)
{
System.out.println("a is greater");
}
else if(d>b)
{
if(d>c)
{
System.out.println("d is greater");
}
else
{
System.out.println("c is greater");
}
}
else
{
System.out.println("b is greater");
}
}
else if(c>b)
{
if(c>d)
{
System.out.println("c is greater");
}

else if(d>a)
{
if(d>b)
{

System.out.println("d is greater");
}
else
{
System.out.println("c is greater");
}
}
else
{
System.out.println("c is greater");
}
}
}
else if(b>c)
{
if(b>d)
{
System.out.println("b is greater");
}
else if(d>b)
{
if(d>c)
{
System.out.println("d is greater");
}
else
{
System.out.println("b is greater");
}
}
else
{
System.out.println("b is greater");
}
}
else if(c>d)
{
if(c>a)
{
System.out.println("c is greater");
}
else
{
System.out.println("c is greater");
}
}
else
{
System.out.println("d is greater");
}
}

}**
```

April 14, 2011 at 12:02 PM

```import java.util.*;
class  FindLargest{
public static void main(String[] args){
int max = Integer.MIN_VALUE;
System.out.println("Enter 4 numbers:");
Scanner input=new Scanner(System.in);

for(int i=1;i<=4;i++){
int num=input.nextInt();
if (num > max) {
max = num;
}
}
System.out.println("Largest Number is: "+max);
}
}
```

April 14, 2011 at 12:15 PM

thanks for give to short coding for this question but my friend first anwser for clearly understand a if else condition(NESTED IF CONDITION)

Related Tutorials/Questions & Answers:
CHECK WHICH NO IS GREATER IN 4 NO'S
CHECK WHICH NO IS GREATER IN 4 NO'S  MAKE A PROGRAM TO CHECK WHICH NO. IS GREATER IN 4 NO'S IN JAVA ???   **class u...) { System.out.println("a is greater
Mysql Date Greater Then
Then' that illustrate you the example to extract the record which is greater than... which are greater than the given date.  Here in this example we... Mysql Date Greater Then
check
updated"); will the above code check if the user has entered value for empcode
Hibernate Criteria Greater Than
Hibernate Criteria Greater Than The Hibernate Criteria Greater Than is used the fetch the value from the database which is Greater than the given value. gt() method of Restriction class is used to find greater value from a given value
Integrating spring 4 with hibernate 4
Integrating spring 4 with hibernate 4  Hi, How to integrate spring 4 with hibernate 4 backed with MySQL database? Thanks   Hi, Spring 4 framework provides the tools and apis for integrating the Hibernate 4. Check
Junit 4
Junit 4  Hello, I need someone to help me with the generic implementation of the toString method testing using Junit 4
check for errors
check for errors  How can I check for errors
How to check if a string exits in a string script in Java script?
How to check if a string exits in a string script in Java script? Java... is an instance based with first class and making it a programming language which... computer science. Here is the video tutorial of "How to check if a string exists
check box left justification
check box left justification  how to make a check box left justification which is at right end? thanks in advance
Spring 4 features
Spring 4 features  Can anyone tell me the spring 4 features? I wan't to learn the new features of Spring 4 framework quickly? Thanks   Spring 4 framework is fully supporting JDK 8 and JEE 7 specification. It provides
password check  how to check sighup passowrd and login password
check anagram
check anagram   compare two input is anagram or not but input contains million words
Get the smallest double greater than the given value
and generate the new smallest double value which greater than the specified...Get the smallest double greater than the given value This section demonstrates you how to get the smallest double value greater than the given value. Java
Simple Example of Hibernate 4
. Share me the best example. Thanks   Hi, Check tutorial: Hibernate 4...Simple Example of Hibernate 4  Hi, As a new comer in the Hibernate... Hibernate 4.2 Tutorial Hibernate 4 Tutorial Hibernate beginner tutorial Thanks
Flex 4
Flex 4 The Flex 4 is open source framework for building Rich Internet (RI) Application. In this section we will see the features of Flex 4. The Flex 4 is open source framework which allows the developers to write applications which
New Features in Hibernate 4
New Features in Hibernate 4  What are the new features in hibernate 4, which is recently released and available for development and deployment... in hibernate 4: Hibernate core now allows to multi-tenancies in three different ways
Hibernate 4
Hibernate 4 Hibernate 4 is the latest version of Hibernate which was released in Jan, 2012. Hibernate 4 comes with many new features such as Multi-tenancy... features of Hibernate 4: Multi-tenancy support The introduction
Mysql Check
Mysql Check       Mysql Check is used to check the existence of table in the database. Understand with Example The Tutorial illustrate an example from 'Mysql Check
xcode 4 create .ipa
xcode 4 create .ipa   Creating ad hoc for iphone distribution in XCode 4   You can edit scheme and assign different configuration...' button and select 'Edit scheme'. You'll see 'Archive' item which allow you
net beans 4
net beans 4  Write a JAVA program to read an initial two number x1... java.util.*; class RelativelyPrime { public static int check(int a, int b... return check(b, a % b); } public static void
How to create spring 4 hibernate 4 maven example program?
How to create spring 4 hibernate 4 maven example program?  Hi, Tell me the easiest to create integrated spring 4 hibernate 4 example which is maven based and can create the war file from the command tool. Thanks
Check PHP MySQL Connectivity
Check PHP MySQL Connectivity: The first step of any kind of connectivity is to check whether the connectivity has been established or not. To check... you to check whether your PHP web page has been connected with MySQL server
Criteria: Greater To Equal criteria Example
Criteria: Greater To Equal criteria Example In this Example, We will discuss... Restriction 'ge' and 'ne'. In This example we search for greater...: The resultant query generated by hibernate is as follows which produces
Create sessionfactory in Hibernate 4
Create sessionfactory in Hibernate 4  How to create sessionfactory in Hibernate 4? Thanks
Version of which>which dependency
List of Version of which>which dependency
JDBC : Salary greater than average salary
JDBC : Salary greater than average salary In this section you will learn how to get records of employee having salary greater than the average salary. Salary greater than average salary : By using AVG(salary) function you can get
type 4 jdbc driver
type 4 jdbc driver   i read in this site that type 4 jdbc driver is the fastest one so used it to connect with the database.......but not tried another drivers,....can u specifically answer me why type 4 is the fastest one