Computer Science, asked by faizan2716, 7 months ago

write a program to input 3 integers and find the difference between their sum and average(full java program)

Answers

Answered by anindyaadhikari13
5

Question:-

  • Write a program in Java to input three integers and find the difference between their sum and average.

Program:-

import java.util.*;

class Number

{

public static void main(String args[])

{

double a,b, c, result;

Scanner sc=new Scanner(System.in);

System.out.println("Enter three numbers. ");

a=sc.nextInt();

b=sc.nextInt();

c=sc.nextInt();

result=(a+b+c)-(a+b+c)/3.0;

System.out.println("Result is: "+result);

}

}

Similar questions