Computer Science, asked by kmrankit83, 11 hours ago

write a progsam to input any three numbes & and print the sum , product and the @ average of the three number

Answers

Answered by xflightyxgirlx
0

exercise 2.17

public class ArithmeticSmallestLargest {

public static void main(String[] args) {

Scanner input = new Scanner(System.in);

int num1;

int num2;

int num3;

int sum;

int average;

int product;

double largest

System.out.print("Enter First Integer: ");

num1 = input.nextInt();

System.out.print("Enter Second Integer: ");

num2 = input.nextInt();

System.out.print("Enter Third Integer: ");

num3 = input.nextInt();

sum = num1 + num2 + num3;

average = sum / 3;

product = num1 * num2 * num3;

if (largest =num1 > num2 & num2 > num3)

System.out.println(sum);

System.out.println(average);

System.out.println(product);

System.out.println("The biggest number is " + largest);

}

}

Share Improve this question Follow

asked

Sep 4 '14 at 21:10

Shairyar Shafqat

97●22 gold badges●44 silver badges●1010 bronze badges edited

Sep 4 '14 at 21:15

рüффп

4,590●3434 gold badges●6262 silver badges●100100 bronze badges

8

Ok. Done - what is exercise 2.18? –

Similar questions