Write a program to input three integers & find the difference between their sum & their average.
Answers
Answered by
0
ANSWER::
10 input x, y, z
20 sum = x + y + z30 average
= sum / 3.040
print averageFor this you would just see a question mark to input the 3 numbers.
Generally in most BASICs you could do this instead:
10 input “Enter 3 numbers separated by spaces :
“; x, y, zThen you get a nice prompt for the input.
plz like and follow ♥
Answered by
2
Answer:
import java.util.*;
public class Brainly
{
static void main()
{
Scanner sc=new Scanner(System.in);
int a,b,c,sum;
float avg,diff;
System.out.println("Enter three integers:");
a=sc.nextInt();
b=sc.nextInt();
c=sc.nextInt();
sum=a+b+c;
avg=(float)sum/3;
diff=sum-avg;
System.out.println("Difference="+diff);
}
}
Similar questions