Question: 5. How would you write the following arithmetic expression in Java? (use Math class) (2 points) 5.5(r+2.5)2.5+t Answer: int a=6; int b=a++; System. out.println (a);


5. How would you write the following arithmetic expression in Java? (use Math class) (2 points) 5.5(r+2.5)2.5+t Answer: int a=6; int b=a++; System. out.println (a); System. out.println (b); a=6; b=++a; System. out.println (a); System. out.println (b); Answer: 7. Show the output of the following code: Explain briefly. ( 2 points) float f=12.5F; int i= (int) f; System.out.println("f is " +f); System.out.println("i is " +i); Answer: 8. Show the output of the following code: Explain briefly. ( 2 points) double amount =5; System.out.println (amount / 2) ; System.out.println((int) amount / 2)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
