find largest value

find largest value

(Assignment 1 - LargestValue)The process of finding the largest value (i.e., the maximum of a group of values) is used frequently in computer applications. Write a Java application (LargestValue.java) that inputs a series of 10 integers and determines and prints the largest integer. Your program should use at least the following three variables: a. counter: A counter to count to 10 (i.e., to keep track of how many numbers have been input and to determine when all 10 numbers have been processed). b. number: The integer most recently input by the user. c. largest: The largest number found so far.

View Answers

February 21, 2011 at 12:20 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 10 numbers:");
        Scanner input=new Scanner(System.in);

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









Related Tutorials/Questions & Answers:
find largest value
find largest value  (Assignment 1 - LargestValue)The process of finding the largest value (i.e., the maximum of a group of values) is used frequently...; Java Find Largest Number import java.util.*; class FindLargest
USE ARRAY TO FIND THE LARGEST NUMBER AND OCCURRENCE
USE ARRAY TO FIND THE LARGEST NUMBER AND OCCURRENCE  i have some... it is: write a program that reads 10 numbers from the keyboard. find the largest number and count the occurrence of the largest number number entered from the keyboard
Advertisements
Find Second Largest Number from an Array
Find Second Largest Number from an Array This section illustrates you how to find the second largest number from an array. For this purpose, we have allowed the user to enter the array elements of their choice and determine the largest
how to find largest number? - Java Interview Questions
how to find largest number?  this is my java coding: import...); } } i don't know how to add code to find the largest number.. please help... want to find the greater number which user enter on the console? Thanks
find the largest number enter by user - Java Interview Questions
find the largest number enter by user  sorry for not stating clearly my question. i want to know how to find the largest number enter by user... value: "); a=in.nextInt(); System.out.println("Enter second value
find largest num enter by user using loop method - Java Interview Questions
find largest num enter by user using loop method  hi..it's me again...(); System.out.println("Enter five value: "); e=in.nextInt(); is it possible to find...); System.out.println("Enter first value: "); a=in.nextInt(); System.out.println("Enter
How to find maximum value in ArrayList
How to find maximum value in ArrayList  **Sir i am writing below code but its not working.i don't know how to implement logic my requirement.My requirement is find maximum value in userdefined objects and dispaly that object
How to find maximum value in ArrayList
How to find maximum value in ArrayList  **Sir i am writing below code but its not working.i don't know how to implement logic my requirement.My requirement is find maximum value in userdefined objects and dispaly that object
How to find maximum value in ArrayList
How to find maximum value in ArrayList  **Sir i am writing below code but its not working.i don't know how to implement logic my requirement.My requirement is find maximum value in userdefined objects and dispaly that object
How to find maximum value in ArrayList
How to find maximum value in ArrayList  **Sir i am writing below code but its not working.i don't know how to implement logic my requirement.My requirement is find maximum value in userdefined objects and dispaly that object
Find Value of Column
Find Value of Column       In this program we are going to find the value of row from... example.xls String table value 0 Name Of Example String table value 1
Find max and min value from Arraylist
Find max and min value from Arraylist In this tutorial, you will learn how to find the maximum and minimum value element from the ArrayList. Java provides direct methods to get maximum and minimum value from any collection class i.e
Find Cylinder area By inputting value from user
Find Cylinder area By inputting value from user  Hello Sir I need the code for calculating the area of a cylinder in which it asks radius value from user and then calculate area using this radius value. Please provide me
How to find maximum value for userdefined objects in ArrayList
How to find maximum value for userdefined objects in ArrayList  Hi sir,I have requirement i.e finding maximum value in userdefined objects... value but can't store that object into another object.Please help me how
How to find maximum value for userdefined objects in ArrayList
How to find maximum value for userdefined objects in ArrayList  Hi sir,I have requirement i.e finding maximum value in userdefined objects... value but can't store that object into another object.Please help me how
How to find maximum value for userdefined objects in ArrayList
How to find maximum value for userdefined objects in ArrayList  Hi sir,I have requirement i.e finding maximum value in userdefined objects... value but can't store that object into another object.Please help me how
how to find [count the number of integers whose value is less than the average value of the integers]
how to find [count the number of integers whose value is less than the average value of the integers]  Construct an algorithm that will prompt... of integers whose value is less than the average value of the integers. Your
generate random numbers and display the largest
it. Write a method to find the largest value in an array. Write a program that takes... to the screen and uses your method to find the largest value in the array, then prints this value to the screen.   import java.util.Random; public class
please please i wanna insertion sort program find calendar to array value (1000,5000,10000), please help me
Insertion sort program find calendar to array value 1000,5000,10000  program find calendar for insertion sort in jfram to array 1000
MySql Absolute Value
MySql Absolute Value This example illustrates how to find the absolute value of the table. In this example we use abs keywords to find the absolute value in the sql query. In the given table the column emp_value define float type when
The largest integer among the X number
The largest integer among the X number  Write an application program that prompts the user to key in a whole number X. The user is then prompted... information : a) The largest integer among the X number of integers keyed in b
ModuleNotFoundError: No module named 'largest-frontal-face-detector'
ModuleNotFoundError: No module named 'largest-frontal-face-detector'  ...: No module named 'largest-frontal-face-detector' How to remove the ModuleNotFoundError: No module named 'largest-frontal-face-detector' error
ModuleNotFoundError: No module named 'largest-frontal-face-detector'
ModuleNotFoundError: No module named 'largest-frontal-face-detector'  ...: No module named 'largest-frontal-face-detector' How to remove the ModuleNotFoundError: No module named 'largest-frontal-face-detector' error
ModuleNotFoundError: No module named 'largest-frontal-face-detector'
ModuleNotFoundError: No module named 'largest-frontal-face-detector'  ...: No module named 'largest-frontal-face-detector' How to remove the ModuleNotFoundError: No module named 'largest-frontal-face-detector' error
Determining the largest number
; conditions that can help you in finding the largest value one by one. ... Determining the largest number     ... the coding for determining the largest number amongst three. Here we have taken three
Determine Average by removing Largest and Smallest Number
. These numbers are then stored into an array in order to find the largest...Determine Average by removing Largest and Smallest Number In this section, you will learn how to remove largest and smallest number from the 10 numbers
find the factorial
find the factorial  how to find the factorial through the while loop...) { int value = 5, factorial = 1, temp = value; while...--; } System.out.println("The factorial of " + value + " is " + factorial
find and substring
find and substring   **import java.io.BufferedReader; import... BufferedReader(new InputStreamReader(System.in)); System.out.println("Enter find...){ } } public void findreplace(String find, String replace
by value or by reference
by value or by reference  Are objects passed by value or by reference
find the given input is integer or string
find the given input is integer or string  simple coding for to check the given input value is integer or no.If the given value is integer display "Value is integer" otherwise "Value is not a integer"?   class
the value of $$b
the value of $$b  If the variable $a is equal to 5 and variable $b is equal to character a, what?s the value of $$b
java find the error5
java find the error5  <%@page import="java.sql.*"%> <%@page..." value="Search"></input> </form> <% ArrayList arrayobj..." > Enter the ID to search: <input type="text" name="searchID" value="<
PASS value
PASS value  javascript to pass value to other html file
C++ code to find Entropy
C++ code to find Entropy   consider a discrete memory less source... probability value : "<<endl; cin>>S0; cout<<"Enter the second probability value : "<<endl; cin>>S1; cout<<"Enter the third
Min Value
Min Value   How to access min value of column from database table?   Hi Samar, You can access minimum value of column from database...(selectQuery); System.out.println("Min Value : " +query.list().get(0
sentinel value
sentinel value  how to count the number of red cars that assume 10 cars using sentinel value
sentinel value
sentinel value  how to count the number of red cars. Assume there are 10 cars.   how to count the number of red cars that assume 10 cars using sentinel value
Update value
Update value  How to update value of database using hibernate ?   Hi Samar, With the help of this code, you will see how can update database using hibernate. package net.roseindia.DAO; import
PHP find online users
PHP find online users  How to find the online users in PHP
find and replace in java
find and replace in java  Need 'find and replace' function in Java to find special keyword in XMl such as @,#,!,%..and replace with their corresponding entities
ModuleNotFoundError: No module named 'find'
ModuleNotFoundError: No module named 'find'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'find' How to remove the ModuleNotFoundError: No module named 'find' error
ModuleNotFoundError: No module named 'find'
ModuleNotFoundError: No module named 'find'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'find' How to remove the ModuleNotFoundError: No module named 'find' error
MySql find and replace string
MySql find and replace string  How to find and replace string or special characters in MySql & PHP?   Find and Replace String PHP $result = preg_replace('/\band\b/i', 'foo', $subject
janusgraph find edge with label
janusgraph find edge with label  Hi, I am working on JanusGraph graph server. I want to find all the edges with a particular label. How to find... for find edge with label: g.V().hasLabel('MyLevel') Thanks
WAP to find HCF
WAP to find HCF  Hi, can any one please share teh code to find the HCF of 2 or 3 numbers
idea for find the worm - Security
idea for find the worm  HI Guys, Please give any advise or code for find the worm and prevent the worm.I am doing the project as a distributed antiworm systems.Please help me
Find city latitude and longitude
Find city latitude and longitude  Hi, I have to find find city latitude and longitude for one of map based application. My application is based on Google map and I am adding cities using city latitude and longitude. In my
find the first character is vowel or not
find the first character is vowel or not  hi friend, can u plz send me javascript code for find the wether the first character is a vowel or not. 2) check wether the last character is same as the first character or not 3) check
to find simple interst
to find simple interst  create a class of object insert with a constructor. write a program to find out simple interest   import java.util....; this.t=t; } public void find(){ double rate=r/100; double
Sort the element find mean
Sort the element find mean  Hi Friend, I want to find meaning of some real numbers like, if we have numbers- 52.15, 89.0, 314.48, 845.75, 309.11, 575.36, 398.98, 318.64, 2485.12, 377.44 Then I want to find

Ads