- Jun 13, 2010
- 68
- 0
- 0
I am trying to convert an int value to double.
This is what I'm working with. I am not aloud to declare the variables with a double, only int.
Result
I need the average to be more than integer.
This is what I'm working with. I am not aloud to declare the variables with a double, only int.
Code:
double a=0,b=1,c=2,d=3;
double average= (a+b+c+d)/4;
System.out.println("The average of " + a + " " + b + " " + c + " and "+d+" is "+average);
Code:
run:
The average of 0.0 1.0 2.0 and 3.0 is 1
BUILD SUCCESSFUL (total time: 0 seconds)
