Computer Science, asked by pbguardian07, 1 month ago

Write a program to accept 3 numbers .Find the highest and lowest among them using max and min library function.

Answers

Answered by bhumikaandmuskan
1

Answer:

Explanation:

import java.util.Scanner;

 

/*

* Java Program to find largest and smallest of three numbers

*/

public class Main {

 

   public static void main(String args[]) {

 

       // creating scanner to accept radius of circle

       Scanner scanner = new Scanner(System.in);

       System.out.println("Welcome in Java program to find largest  

                    and smallest of three numbers");

 

       System.out.println("Please enter first number :");

       int first = scanner.nextInt();

 

       System.out.println("Please enter second number :");

       int second = scanner.nextInt();

 

       System.out.println("Please enter third number :");

       int third = scanner.nextInt();

 

       int largest = largest(first, second, third);

       int smallest = smallest(first, second, third);

 

       System.out.printf("largest of three numbers %d, %d, and %d is : %d %n",

                                  first, second, third, largest);

       System.out.printf("smallest of three numbers %d, %d, and %d is : %d %n",  

                              first, second, third, smallest);

 

       scanner.close();

Answered by poojipoojitha2004
0

Answer:

what is the meeting about??

Similar questions