7. 2. The output of the statement print ('%2f', 11.1234) is 11.12 b. 11.1234 11.23 d. 11/
Answers
Answered by
0
From the given question the correct answer is
The output of the statement print ('%2f', 11.1234) is 11.1234.
Answered by
0
The output of the statement print ('%2f', 11.1234) is 11.1234
- The % in the given statement acts as a special character to let the compiler know that it has to be replaced.
- The f represents the floating-point number.
- 2f means that only take the number till 2 digits before the decimal.
- And thus when all this is applied to 11.1234 it will print the number as it is because only two digits are present before the decimal already.
- In the case of JAVA, the exact output would be 11.123400 because JAVA prints 6 precision figures after the decimal.
Similar questions
English,
20 days ago
Chemistry,
1 month ago
Social Sciences,
1 month ago
Physics,
9 months ago
History,
9 months ago
Political Science,
9 months ago