-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShown.java
More file actions
44 lines (28 loc) · 1.26 KB
/
Shown.java
File metadata and controls
44 lines (28 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import java.util.Scanner;
public class Shown{
public static void main(String[] args){
Scanner input = new Scanner(System.in);
System.out.print("Enter first number: ");
int num1 = input.nextInt();
System.out.print("Enter second number: ");
int num2 = input.nextInt();
System.out.print("Enter third number: ");
int num3 = input.nextInt();
int sum = (num1 + num2 + num3);
int product = (num1 * num2 * num3);
int average = (sum / 3);
System.out.printf("%d this is the total of all the number and %d is the average of the 3 numbers combined and %d is everything multiplied ", sum,average,product);
if (num1 > num2 && num1 > num3)
System.out.printf("%d is the largest number of all numbers listed ", num1);
if (num2 > num1 && num2 > num3)
System.out.printf("%d is the largest number of all numbers listed ", num2);
if (num3 > num2 && num3 > num1)
System.out.printf("%d is the largest number of all numbers listed ", num3);
if (num1 < num2 && num1 < num3)
System.out.printf("%d is the smallest number of all numbers listed ", num1);
if (num2 < num1 && num2 < num3)
System.out.printf("%d is the smallest number of all numbers listed ", num2);
if (num3 < num2 && num3 < num1)
System.out.printf("%d is the smallest number of all numbers listed ", num3);
}
}