1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Rus_ich [418]
3 years ago
13

5-11) (Find the Smallest Value) Write an application that finds the smallest of several integers. Write a program which first as

ks the user to enter the number of values to enter, then asks for each value, and finally prints out the lowest value of those entered.
Computers and Technology
1 answer:
Elanso [62]3 years ago
8 0

Answer:

import java.util.Arrays;

import java.util.Scanner;

public class num4 {

   public static void main(String[] args) {

   Scanner in = new Scanner(System.in);

       System.out.println("How many numbers? ");

       int n = in.nextInt();

       int []intArray = new int[n];

       //Entering the values

       for(int i=0; i<intArray.length;i++){

           System.out.println("Enter the numbers");

           intArray[i]=in.nextInt();

       }

       System.out.println(Arrays.toString(intArray));

       int min =intArray[0];

       for(int i =0; i<intArray.length; i++){

           if(min>intArray[i]){

               min = intArray[i];

           }

       }

       System.out.println("The Minimum of the numbers is "+min);

   }

}

Explanation:

  • Using Java programming language
  • Prompt the user for the number of values
  • Using Scanner class receive and store in a variable
  • Create an array of size n
  • Using an for loop continuously ask the user to enter the integers
  • Print the array of integers
  • Using another for loop with an if statement, find the smallest element in the array of numbers
  • Output the the smallest number
You might be interested in
Leo lives in a two-story home in an upscale neighborhood, drives a brand-new sports car, and makes more than $250,000 per year.
prisoha [69]
(D) Standard of living. Because, from this text you can tell that Leo is a wealthy person, and welthy people tend to get the best things, including fancy neighborhoods and Cars. So its most likely (D)
5 0
3 years ago
Read 2 more answers
In a social networking site your personal information is listed under your?
abruzzese [7]
Profile? Perhaps... If you go on social media sites like Facebook it's typically on your profile, right?
3 0
3 years ago
Read 2 more answers
What is the use of an NDP?
Makovka662 [10]

Answer:

It defines five ICMPv6 packet types for router solicitation,router advertisement,neighbor solicitation,neighbor advertisement,and network redirects.

Explanation:

8 0
2 years ago
What is a characteristic ofa good cloud-based hosting?
Aliun [14]

Answer:

Explanation:

A good cloud-based hosting has many beneficial characteristics, some of which include on-demand self-service, broad network access, and being very elastic and scalable. These characteristics allow for a large number of users to benefit from the service at any time of the day and at a very fast speed due to the broad network access.

6 0
3 years ago
What does it mena when they say "all germs are germs"
KiRa [710]

Answer:it means that germs are germs germs are reproductive they split apart from one another to create more germs.

Explanation:

7 0
3 years ago
Other questions:
  • What are issues to consider when deciding to build software in-house or purchase commercial off-the-shelf software (cots)?
    14·1 answer
  • Write a program to read data from a file named problem 2. ext. This file has three exams data (floating point data) in three col
    11·1 answer
  • А.<br> is the highest education degree available at a community college.
    6·1 answer
  • 12. When trying to identify the sorted column in a table, you would look for the column where A. an arrow is displayed in the fi
    10·2 answers
  • Which option in Outlook allows a user to look at multiple calendars in a side-by-side fashion?
    14·2 answers
  • The Software Engineering Code of Ethics and Professional Practice was developed by Select one: a. Computer Professionals for Soc
    7·1 answer
  • URLs are the global ______ of resources on the Internet.
    12·2 answers
  • To maintain your body temperature, your body converts chemical potential energy into thermal energy T or F
    6·1 answer
  • It is a single strand of metal capable of transmitting power or data from one area to<br> another
    11·1 answer
  • How many answer can you get daily
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!