Home Answers Viewqa Java-Beginners CHECK WHICH NO IS GREATER IN 4 NO'S

 
 


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

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

View Answers

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 Pages:
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
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
Mysql Date Greater Then
Then' that illustrate you the example to extract the record which is greater than... of the  employee which are greater than the given date.  Here in this example we... Mysql Date Greater Then      
jQuery check username availability using JSP
; Value must be greater than 4 characters</div> <div style="...jQuery check username availability using JSP In this section, you will learn to check username availability from database using JSP & jQuery
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
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
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
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
Common Interview Questions Page - 4
Common Interview Questions Page - 4   ...: Working together as a team is the key point in achieving greater goal than... skills in school or college days. You can mention your previous work in 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
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
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
check box left justification
check box left justification  how to make a check box left justification which is at right end? thanks in advance
Flex 4 Features
Flex 4 Features Flex released its new version Flex 4 with huge changes... application builder tool named ?Flash Builder? which was formerly known as ?Flex... Flex 4 features: Flex 4 delivers wide variety of new and enhanced features
Criteria: Greater To Equal criteria for Date type
Criteria: Greater To Equal criteria for Date type In this Example, We... Restriction 'ge'. In This example we search for greater to equal ...: The resultant query generated by hibernate is as follows which produces
Set background image for Spark BorderContainer in flex 4
Set background image for Spark BorderContainer in flex 4 :- In this example you can see how to set background image for BorderContainer  in Flex 4. The BorderContainer  has a property to set the image in background which
Check even or odd number.
Check even or odd number.  How to check given number is even or odd..."); } } } Description: num is variable which hold the inputted number. BufferReader is used for inputting number. Even numbers are those numbers, which are divisible
check
updated"); will the above code check if the user has entered value for empcode
Check for character in lower case or not.
Description: This tutorial demonstrate the use of Character.isLowerCase() method which checks   whether the value stored in char data-type varible is in lower case or not. Code: public 
Hi ...CHECK - Java Beginners
frend, Plz explain about the two classes which not exist in this code
Download Hibernate 4
Download Hibernate 4 In this tutorial you will learn about how to download the Hibernate 4. Download the Hibernate To Download the latest version.../files/ When you will download the hibernate 4 jar file you should be care about
Hello World in Flex 4
.style1 { background-color: #FFFFCC; } Hello World In Flex 4:- First you will install a Flash Builder 4 in your system for creating a Flex application in Flex 4. Now the question will arise How we will make a flex project
Java Programming: Chapter 4 Index
Chapter 4 Programming in the Large I Subroutines ONE WAY... subroutines and then use them to help write more complex subroutines, which can..., which are used in true object-oriented programming, will be covered
Java Programming: Chapter 4 Quiz
Quiz Questions For Chapter 4 THIS PAGE CONTAINS A SAMPLE quiz on material from Chapter 4 of this on-line Java textbook. You should be able.... Question 4: Discuss the concept of parameters. What are parameters for? What
4 C's of Marketing Mix
As 4 P's of marketing mix was basically a product oriented model, Robert F. Lauter born in 1993 proposed a 4 Cs classification model that is a consumer... be said that 4 C's concept is a consumer-oriented version of 4 P's concept
Check if the directory is empty or not
Check if the directory is empty or not In this section, you will learn how to check if the directory is empty or not. Java IO package works with both files and directories. Here we are going to check whether directory is empty
Java Programming: Chapter 4 Exercises
Programming Exercises For Chapter 4 THIS PAGE CONTAINS programming exercises based on material from Chapter 4 of this on-line Java textbook... will be based on the non-standard Mosaic class, which was described in Section 4.6.
Flex 4 Hello World
Flex 4 Hello World Developing Hello World Example in Flex 4 using Flash Builder 4 Before creating Hello World example, you need flash builder 4 installed already in your system. Open Flash Builder 4 and follow the following steps
Applet - spell check program - Applet
Applet - spell check program  hi, i am writing a applet program -say ' spelling checking utility ' i need to a read text file and check whether... develed using Ternary search tree and finds synonyms, gives words which
Chapter 4. Demonstrate understanding of database connectivity and messaging within IBM WebShpere Application Server
Chapter 4. Demonstrate understanding of database.... Exam Objectives Next    Chapter 4. ... or connection factory. For example, if you run a three server cluster in which all
java bits 4 - Java Interview Questions
java bits 4   Given: 31. // some code here 32. try { 33. // some code here 34. } catch (SomeException se) { 35. // some code here 36. } finally { 37. // some code here 38. } Under which three circumstances will the code
Check for character is letter or not.
Description: This tutorial demonstrate the use of Character.isLetter() method which checks whether the value stored in char data-type variable is letter or not. Code: public class CheckLetter 
Xcarecrows 4 XML
and the XML schemas which describe them. Integration Xcarecrows 4 ... Xcarecrows 4 XML       Xcarecrows 4 XML, Cogenit's new Eclipse plugin, is an efficient
Check for character is digit or not.
Description: This tutorial demonstrate the use of Character.isDigit() method which checks whether the value stored in char data-type variable is digit or not. Code: public class CheckDigit 
Spring Dependency-Check
Spring Dependency-Check In this tutorial you will see how to check.... It check for all bean's dependencies, that is expressed in its properties are satisfied or not. The dependency-check attribute is set in the <bean/>
Flex 4 getting started, Getting Started with Flex 4
Getting started with Flex 4 Prior to begin working in Flex 4, you must have... in assessing the fundamentals of Flex 4.  Flex 4 is the updated version of Flex 3 in which some extra features have been included, which ease the difficulty
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
Creating Check Box in Java Swing
Creating Check Box in Java Swing       This section illustrates you how to create a Check Box component in Java Swing. In this section, you can learn simply creating the Check Box
First Hibernate 4 Example with Eclipse
First Hibernate 4 Example with Eclipse In this tutorial you will learn that how easily you can do your first example of Hibernate 4 with Eclipse First of all to do an example of Hibernate 4 you should have installed an appropriate
how to check and print the no of times an integer is repeated in an array
how to check and print the no of times an integer is repeated in an array  how to check and print the no of times an integer is repeated in an array??? suppose my input is 2 4 2 5 2 4 3 4 5 2 then my output should be 2-4
JSTL - check odd/even number - JSP-Servlet
JSTL - check odd/even number  How do i create a JSTL program to generate random numbers and to check whether they are odd/even and print... is 4. It is an even number between 3 and 5. Much thanks all!  Hi
JSP check email exists or not
JSP check email exists or not In this tutorial, you will learn how to check... accepts the email id from the user and check whether the given email id already...;text/javascript"> function check(value){ xmlHttp=GetXmlHttpObject
4 P's of Marketing Mix
4 P's of Marketing Mix of marketing was first proposed by E. Jerome McCarthy in 1960, which defines four factors essential for evaluating the business.... Prices The second P of marketing mix stands for 'Price', which is defined
Chapter 4. Session Bean Life Cycle
Chapter 4. Session Bean Life CyclePrev Part I. Exam Objectives Next     Chapter 4. Session... with which the instance is currently associated or in an unspecified
Java Programming: Chapter 4 Quiz Answers
Sample Quiz Answers For Chapter 4 THIS PAGE CONTAINS SAMPLE ANSWERS to the Quiz on Chapter 4 of this on-line Java textbook. Note.... Question 4: Discuss the concept of parameters. What are parameters
Difficult Interview Questions Page -4
Difficult Interview Questions Page -4   ...;   or   How would you describe the pace at which you work? ... the check your presence of mind. Be  positive and  deliver  your 
sanity check on key recorder - Java Beginners
sanity check on key recorder  In this code, it records both IE...(); } //function to display which key is used function getkey(e, obj... to to display which key is used outside of text box function displayit(e
Check if parameter exists in servlet request
Check if parameter exists in servlet request... will see how to check is parameter exists in servlet request. In this example...="Parameter4" value="4"></td></tr>
java image slider or code 4 java-image slideshow
java image slider or code 4 java-image slideshow   plz help me out with java code for running an application in which images wil slide automatically...;hi, d code mentioned above will run in visual studio ri8? do u hav d code 4
Junit 4
Junit 4  Hello, I need someone to help me with the generic implementation of the toString method testing using Junit 4

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.