Largest Number – Java Program

Here is a simple Java program that takes 3 inputs in integer from the user and prints the largest number.

Screen Shot 2018-04-12 at 9.52.09 PM

import java.util.Scanner;

public class biggestnumber {
public static void main(String args[])
int d = 0;
int v = 0;
Scanner firstnumber = new Scanner(;
System.out.println(“Enter first number: “);
int a = firstnumber.nextInt();

Scanner secondnumber = new Scanner(;
System.out.println(“Enter second number: “);
int b = secondnumber.nextInt();

Scanner reader = new Scanner(;
System.out.println(“Enter third number: “);
int c = reader.nextInt();

if (a>b)
d = a;
d = b;

if (d>c)
v = d;
v = c;



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s