write a program to input 3 integers and find the difference between their sum and average(full java program)
Answers
Answered by
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
Math,
3 months ago
Math,
3 months ago
Math,
3 months ago
Social Sciences,
7 months ago
Math,
1 year ago