Send Close Add comments: (status displays here)
Got it!  This site uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website.nbsp; Note: This appears on each machine/browser from which this site is accessed.
Printf strings


1. Printf strings

2. Printf
The formatted print command printf, as found in many languages, is a mini-DSL that helps in creating formatted output. Below are some examples. Note that JavaScript has no built-in formatted print so normal output is used.

3. C code
Here is the C code.


4. C output
Here is the output of the C code.


5. Go code
Here is the Go code.


6. Go output
Here is the output of the Go code.


7. Java code
Here is the Java code.


8. Java output
Here is the output of the Java code.


9. JavaScript code
Here is the JavaScript code.


10. JavaScript output
Here is the output of the JavaScript code.


11. Lua code
Here is the Lua code.


12. Lua output
Here is the output of the Lua code.


13. PHP code
Here is the PHP code.


14. PHP output
Here is the output of the PHP code.


15. Python code
Here is the Python code.


16. Python output
Here is the output of the Python code.


17. End of page