How To Create A Java Program That Will Create The Sum, Product And Average Of 3 Numbers;3,4 And 5?

2

2 Answers

Abir hasan Profile
Abir hasan answered
Public static void main(String[] args) throws IOException {
int b,c,n,sum;
String a,x,y,z;
// TODO code application logic here
System.out.println("Enter Interer Value only....");
BufferedReader mno=new BufferedReader(new InputStreamReader (System.in));
a= mno.readLine();
n=Integer.parseInt(a);
y=mno.readLine();
c=Integer.parseInt(y);
x= mno.readLine();
b=Integer.parseInt(x);
sum=(n+c+b);
System.out.println("result is :"+sum);
}
}
hope Sum problem will solve by use this method..
Anonymous Profile
Anonymous answered
Public static void main() {
// declare variables
int num1, num2, num3;
int sum, product;
double avg;

// Variables initial values
num1 = 3;
num2 = 4;
num3 = 5;

// calculate sum, product, and average

sum = (num1 + num2 + num3);
product = (num1 * num2 * num3);
avg = sum/3;

// print

System.out.print("Sum = " + sum);
System.out.print("Product = " + product);
System.out.print("Average = " + avg);
}

Hope this is what you want

Answer Question

Anonymous