Programming Shortcut

Write, Run and execute Your programs with simple and esay way by Programming Shortcut

Monday, February 4, 2019

Biggest and smallest from three given numbers in java

Hello friends! Welcome to my website
Java programming to find the biggest and the smallest number between two numbers?
This Java language programming is free all type of errors like the compiler and runtime errors and this programming is tested to compile and then run the program code.
Here is only programming code with the output. This programming output is customized to understand easily.

Find the Biggest and smallest number from three given numbers in java

import java.util.Scanner;
class test {
    int a, b, c;
    public void biggest(int a, int b, int c) {
        if (a > b && a > c) {
            System.out.println(a+" is "+" biggest than "+b+" and "+c);
        }
        else if (b > a && b > c) {
            System.out.println(b+" is "+" biggest than "+a+" and "+c);
        }
        else{
            System.out.println(c+" is "+" biggest than "+a+" and "+b);
        }
    }
    public void smallest(int a, int b, int c) {
        if (a < b && a < c) {
            System.out.println(a+" is "+" smallest than "+b+" and "+c);
        }
        else if (b < a && b < c) {
            System.out.println(b+" is "+" smallest than "+a+" and "+c);
        }
        else{
            System.out.println(c+" is "+" smallest than "+a+" and "+b);
        }
    }
}
public class biggest {
    public static void main(String[] args) {
       test o = new test();
       Scanner c = new Scanner(System.in);
       System.out.print("Please Enter frsit number: ");
       o.a= c.nextInt();
       System.out.print("Please Enter second number: ");
       o.b= c.nextInt();
       System.out.print("Please Enter third number: ");
       o.c= c.nextInt();
   System.out.println("---------------");
       o.biggest(o.a, o.b, o.c);
       System.out.println("---------------");
       o.smallest(o.a, o.b, o.c);
    }
}


Output:
Please Enter first number: 12
Please Enter second number: 15
Please Enter third number: 11
---------------
15 is  biggest than 12 and 11
---------------
11 is  smallest than 12 and 15

I make this programming and hope you are like the post if are you like the post you can please comment and Share the post to reach more people.
If any doubt about this Java programming code or input & output please comment below
If you have another question about Java programming send an email by contacting us form are given on the page right side.

Please share your experience about this post,
Thank You!

Programming Shortcut is collections in java best programs with example, best c programs with example and best c++ programs with example, best way to learn java, c and c++

About Programming Shortcut

This is a programming learning website that can help you learn and when your write your programming code. And all programming code is compiled run programming code in the following programming language C, c++, Java, php and Javascript Languages. find your programming read, understand the programming then copy and past and run your program and save your golden time to typing the program becuse you learn more in leas time. All Programming is codeing is ease to understand the programming