Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners greatest of 3 numbers using classes and functions.

Have Programming Question? Ask it here!
 
 
 


divya
greatest of 3 numbers using classes and functions.
2 Answer(s)      3 years and 6 months ago
Posted in : Java Beginners


WAP to calculate greatest of 3 numbers using classes and functions with parameters through input in main?


Advertisement
View Answers

February 21, 2011 at 12:18 PM


Java Find Largest Number

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

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


February 21, 2011 at 10:00 PM


Thanks for ur help ..



Related Tutorials/Questions & Answers:
greatest of 3 numbers using classes and functions.
greatest of 3 numbers using classes and functions.  WAP to calculate greatest of 3 numbers using classes and functions with parameters through input..._VALUE; System.out.println("Enter 3 numbers:"); Scanner input
convert numbers to strings using JavaScript
convert numbers to strings using JavaScript  How to convert numbers to strings using JavaScript
Advertisements
Math Constants and Functions using JavaScript
Math Constants and Functions using JavaScript  What's Math Constants and Functions using JavaScript
associate functions with objects using JavaScript
associate functions with objects using JavaScript  How to associate functions with objects using JavaScript
Lost Using Swing Components(3)
Lost Using Swing Components(3)  Hello, I sound like every other newbie but I desperately need help. I have to write an application for the WebBuy Company that allows a user to compose the three parts of a complete email message
print 100 numbers using loops
print 100 numbers using loops  how to print from 1 to 100 using for loop ?   Hi Friend, You can use the following code: class Loop...); } } } Thanks   class Numbers { public satic void main
add tow numbers with out using arthamatic operaters
add tow numbers with out using arthamatic operaters  add tow numbers with out using arthamatic operaters
adding two numbers using bitwise operators
adding two numbers using bitwise operators  adding two integer numbers with using bitwise opeators   Hi Friend, Try the following code: public class AddNumberUsingBitwiseOperators { public static void main(String
adding two numbers with out using any operator
adding two numbers with out using any operator  how to add two numbers with out using any operator   import java.math.*; class AddNumbers { public static void main(String[] args) { BigInteger num1=new
Find HCF of three numbers in Java Program
: 14 Enter Number 3: 28 HCF of three numbers 7,14 and 28 is: 7...Find HCF of three numbers in Java Program In this java tutorial section, you will learn how to determine the HCF (Highest Common Factor) or GCD (Greatest
3
to this output stream using the specified format string and arguments
Program using String functions - Java Beginners
Program using String functions  Write a program to accept a sentence and find out how many times the word "the" occurs?  Hi Friend, Try the following code: import java.util.*; class CountSameWords
how to display nth greatest salary - SQL
how to display nth greatest salary  how to display nth greatest salary
how to calculate addition of two distances in feets and inches using objects as functions arguments
how to calculate addition of two distances in feets and inches using objects as functions arguments  how to calculate addition of two distances in feets and inches using objects as functions arguments in java
How can we get the properties (size, type, width, height) of an image using php image functions?
How can we get the properties (size, type, width, height) of an image using php image functions?  How can we get the properties (size, type, width, height) of an image using php image functions
Q, 12 WAP to calculate addition of two distances in feets and inches using objects as functions arguments in java
Q, 12 WAP to calculate addition of two distances in feets and inches using objects as functions arguments in java  Q, 12 WAP to calculate addition of two distances in feets and inches using objects as functions arguments in java
WAP to calculate addition of two distances in feets and inches using objects as functions arguments in java
WAP to calculate addition of two distances in feets and inches using objects as functions arguments in java  WAP to calculate addition of two distances in feets and inches using objects as functions arguments in java   
WAP to calculate addition of two distances in feets and inches using objects as functions arguments in java
WAP to calculate addition of two distances in feets and inches using objects as functions arguments in java  WAP to calculate addition of two distances in feets and inches using objects as functions arguments in java   
WAP to calculate addition of two distances in feets and inches using objects as functions arguments in java
WAP to calculate addition of two distances in feets and inches using objects as functions arguments in java  WAP to calculate addition of two distances in feets and inches using objects as functions arguments in java   
What is Character Functions
What is Character Functions  What is Character Functions   Hi, Here is the answer, Character Functions are INITCAP, UPPER, LOWER, SUBSTR & LENGTH. Additional functions are GREATEST & LEAST. Group Functions
linking jsp with database using classes and methods and then access them all in to my jsp page - JSP-Servlet
linking jsp with database using classes and methods and then access them all in to my jsp page  how to connect jsp page with mysql using classes... to write down the classes and methods in the different folder and then call them
automorphic numbers
automorphic numbers  how to find automorphic number in java   Hi Friend, Pleas visit the following link: Automorphic numbers Thanks
What is functions?
What is functions?  Hi, Please tell me about PHP functions? Thanks in advance
What is functions?
What is functions?  Hi, Please tell me about PHP functions? Thanks in advance
What is functions?
What is functions?  Hi, Please tell me about PHP functions? Thanks in advance.   About Functions: Functions in PHP is block of code... functions and use it multiple times. In PHP there is many pre-defined functions
Inbuild functions
Inbuild functions  List all the inbuild functions in java
Add Complex Numbers Java
How to Add Complex Numbers Java In this Java tutorial section, you will learn how to add complex Numbers in Java Programming Language. As you are already aware of Complex numbers. It is composed of two part - a real part and an imaginary
Prime Numbers
Prime Numbers  Create a complete Java program that allows the user to enter a positive integer n, and which then creates and populates an int array with the first n prime numbers. Your program should then display the contents
Swap two numbers without using third variable
Swap two numbers without using third variable In this section we are going to swap two variables without using the third variable. For this, we have used... from the command prompt. Instead of using temporary variable, we have done some
Calculate the Sum of three Numbers
. In this section you will learn how to calculate the sum of three numbers by using three... Calculate the Sum of Three Numbers   ...; To assign the value of the numbers define a method main. Remember we
Mysql Join 3 Tables
Mysql Join 3 Tables       Mysql Join 3 Tables is used to join 3 Tables using left join... an example from 'Mysql Join 3 Tables' using Left Join. To grasp this example
JavaScript array of functions
in understanding a JavaScript array of functions. For this we are using Java Script... JavaScript array of functions   ...;array1[3] = "Rohini";    return array1
static functions
2. Static Functions 3. Instance Variable  Static Variables Static... variables. 3)A single copy to be shared by all instances of the class. 4)A static... call only other static methods and can not call a non-static method from it. 3
How to put text file numbers to array and check the position of numbers?
How to put text file numbers to array and check the position of numbers?   I have numbers in text file data.txt 12 9 8 3 1
Java classes
Java classes  Which class is extended by all other classes
DAO Classes
DAO Classes  login page code for Dao classes
Generate array of random numbers
: Enter 10 numbers: 1 2 3 4 5...Generate array of random numbers You can generate a random number either by using the Random class or by using the static method Math.random
Web 3
pages. To make available structured data using RDF is primarily focused... operations through using sets of rules expressing logical relationships between... ways to connect and collaborate using 3D shared spaces. Proposed Expanded
java classes
java classes  Which class is the super class for all classes in java.lang package
How to Use Java Functions In EL
How to Use Java Functions In EL          To use a Java Functions in  EL we.... The java class: In this class the functions declared must be public
wrapper classes
wrapper classes  Explain wrapper classes and their use?   Java Wrapper Class Wrapper class is a wrapper around a primitive data type... of the primitive wrapper classes in Java are immutable i.e. once assigned a value
classes in c++
classes in c++  1- design and implement a class datatype that implement the day of the week in the program.the class datatype should store the day... = 2; final static int WED = 3; final static int THU = 4
Introduction to spring 3, Spring framework 3
Introduction to spring 3 In this section we will discuss about Spring 3 framework. Finally Spring 3 is here with new features and enhancements. The Spring... using Java technologies. It is not the replacement of existing technologies
help me 3
help me 3  write aprogram in java using two dimentional array.Accept the two dimentional array from the user and perform addition and subtraction of these two arrays and display the result for each add and subtruct
Inner classes
Inner classes   Hi I am bharat . I am student learning java course . I have one question about inner classes . question is how to access the instance method of Non-static classes which is defined in the outer
php classes and objects
php classes and objects  using a object with a member method of the class
PHP Functions, PHP Functions Tutorials
PHP Functions In this section we will understand important PHP functions with the help of example code. What is Functions? Function is a block of code...; } Functions in PHP PHP provides many built-in functions to do the real job
Hexadecimal numbers multiplication
Hexadecimal numbers multiplication  Sir, I have to multiply 128 bit hexadecimal numbers. Do u have any logic for this?? The numbers are like ab7564fa342b5412c34d9e67ab341b58
Advertisements
 

 

 

DMCA.com