Output Formatting
Syntax:
printf("format string", arguments...);
printf("Age: %d", 25);
Common Format Specifiers
Specifier | Meaning |
|---|---|
| int |
| float/double |
| char |
| string (char*) |
| pointer (address) |
| hex (lowercase) |
| hex (uppercase) |
| octal |
printf("%d %f %c %s", 10, 3.14, 'A', "hello");
int x = 10;
printf("%p", &x);
Last modified: 25 March 2026