Fraction calculations

Viewed 50

I have tried the code below so many times but I am always getting the answer as 11.0.

This is an error as the answer should be 10.83 and I don't want to round off. How should I tackle this?

Here is the code

public class Question_4_Expression_Calculator {
    public static void main(String[] args) {
            // TODO Auto-generated method stub
            double a = 10;
            double b = 7/3;
            double c = 12/8;
            //double x = ((a)+(b)-(c));
            System.out.println("Result is "+ (double)(x);   
    }
}

0 Answers
Related