printf()
Writes formatted output.
Syntax
printf("format", ...)Description
Writes with placeholders: %d integer, %f float, %c character, %s text. Add \n for a new line.
Example
Loading editor…
Expected output
Number: 42 Text: Alex
When to use?
Showing results, debugging.
Common mistakes
- ⚠️ New lines are not automatic; don't forget to add \n.
- ⚠️ Printing text with %d or numbers with %s is undefined behavior.