Question: int i = 3 4 3 4 ; double d = 3 4 3 4 System.out.printf ( % 5 . 1 f % 5

int i=3434; double d=3434
System.out.printf("%5.1f %5.1f", i, d);
i is an integer, but the format specifier %5.1f specifies a format for double value. The code has an error.
The code compiles and runs fine to display 3434.03434.0.
The code compiles and runs fine to display 34343434.0.
 int i=3434; double d=3434 System.out.printf("%5.1f %5.1f", i, d); i is an

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!