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
alukav5142 [94]
3 years ago
12

Write a java program to input two double type numbers and by using suitable mathematical functions print the maximum and minimum

numbers out of the two numbers.
java \: me \: likhna \: ok

​
Computers and Technology
1 answer:
ANTONII [103]3 years ago
3 0

Answer:

The program in Java is as follows:

import java.util.Scanner;

public class Main{

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

 double n1, n2;

 n1 = input.nextDouble();

 n2 = input.nextDouble();

 double Max = Math.max(n1,n2);

 double Min = Math.min(n1,n2);

 System.out.println("Max: "+Max);

 System.out.println("Min: "+Min); }}

Explanation:

This declares the numbers

 double n1, n2;

This gets input for n1

 n1 = input.nextDouble();

This gets input for n2

 n2 = input.nextDouble();

This gets the max of both using the max function

 double Max = Math.max(n1,n2);

This gets the min of both using the min function

 double Min = Math.min(n1,n2);

This prints the max

 System.out.println("Max: "+Max);

This prints the min

 System.out.println("Min: "+Min);

You might be interested in
In a network, a computer that performs specific services for other computers on the network is called a
klio [65]
Motherboard or main sequence processor 
(either that  a mainframe or a server)
hope this helps

8 0
4 years ago
Nothing bottomnothing
elena-s [515]

Answer:humans need energy to complete the regular body requirements to digest our food,to breathe,to move,to run,to travel and continue the metabolism of our regular life.

Explanation:energy is essential to life and all living thing organisms.

8 0
4 years ago
PLEASE HELP!
ss7ja [257]

Explanation:

Case-sensitivity is inherently faster to parse (albeit only slightly) since it can compare character sequences directly without having to figure out which characters are equivalent to each other. It allows the implementer of a class/library to control how casing is used in the code.

3 0
3 years ago
How do I delete my Brainly account?
Triss [41]

Answer:

yeah how? please tell me

Explanation:

5 0
2 years ago
Read 2 more answers
A _______ read inputs the first data item from a file. It typically appears immediately before the loop that processes the data
Evgesh-ka [11]

Answer:

the answer is priming read

Explanation:

hope it helps u

8 0
3 years ago
Other questions:
  • Which of these is NOT an advantage of the impact of computer careers.
    9·1 answer
  • 1.Which type of camera tool pushes the picture back and makes it wider, exaggerating the distance between the background and for
    13·2 answers
  • A(n) __________ item is a hardware or software item that is to be modified and revised throughout its life cycle
    10·1 answer
  • No production Web application, whether it resides inside or outside of the firewall, should be implemented without:
    6·1 answer
  • For enterprise servers, or servers accessed around the clock, SATA disks are preferred over SAS disks. True or False
    12·1 answer
  • Identify what a computer needs to
    14·1 answer
  • The algorithm for solving the problem of average of five (5) numbers​
    10·1 answer
  • Practising some questions for board exams for class 12 python,pls help with detailed answer
    14·1 answer
  • A company is looking for an employee to assign passwords to all of its
    5·1 answer
  • Public class Billing {
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!