The statement System.out.printf("%5d", 123456) outputs ___________.
a. 12345
b. 23456
c. 123456
d. 12345.6
c %5d specifies an integer with width 5 . The width is automatically expanded if the number is larger than the specified width. So, the correct answer is C.
Computer Science & Information Technology
You might also like to view...
Match the following expression elements to their example
I. Identifier II. Operator III. Logical operator IV. Function V. Constant A. Strings of text B. [+] or [–] signs C. Names of a field D. Sum, Count, and Avg E. And, Or, and Not
Computer Science & Information Technology
According to Excel's order of operations, addition and subtraction are done before exponentiation
Indicate whether the statement is true or false
Computer Science & Information Technology