What is the answer of system.out.println(9f/4) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the answer of system.out.println(9f/4)

don't know

11th Mar 2017, 7:08 AM
sabera
sabera - avatar
3 Answers
+ 1
ERROR 1:- S should be capital ERROR 2:- Semicolon is missing. OUTPUT:- 2.25 because 9f/4 means float value of 9/4 which is 2.25.
11th Mar 2017, 7:52 AM
Meharban Singh
Meharban Singh - avatar
0
First, 9 is interpreted as a float, because of the "f", so you actually have 9.0/4, which evaluates to 2.25
11th Mar 2017, 7:27 AM
Álvaro
- 1
2. for accurate answer try this. System.out.println((double)9/4);
11th Mar 2017, 7:16 AM
Vishal Prajapati