My salary is sh.20,000, and I agree to give you half using the following calculation in java: Int half = 20,000 * (1/2); How much do you...

      

My salary is sh.20,000, and I agree to give you half using the following calculation in java:
Int half = 20,000 * (1/2);
How much do you get?

  

Answers


Davis
Unfortunately, you get zero, as (1/2) is calculated first, resulting in 0.multiply by 0.5 instead.
Githiari answered the question on January 26, 2018 at 12:27


Next: In the following, what are the values of the variables after each statement when coding a java program? Int a, b, c, d; d = -8; a =...
Previous: State the values that end up in a, b, c, and d, after these calculations are performed using java programming language. Int a, b, c, d; a...

View More Computer Studies Questions and Answers | Return to Questions Index


Exams With Marking Schemes

Related Questions