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

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

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!