โ Back to Printing
Question 283
Force a Plus Sign
Force a Plus Sign
UseSystem.out.printfwith the%+dspecifier so that positive numbers show a leading+. Print the number 42 as: +42 End the format string with%nfor the newline.
Expected Output:
+42
Topics:
Printing
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (sysout, psvm, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.