Number Bases
Completed
Print the number 255 in decimal, hexadecimal (%x), upper-case hex (%X) and octal (%o), separated by spaces.
Input
None.
Output
One line.
Example
Output
255 ff FF 377
Editor
C
Hints
The same value can be printed in different bases just by changing the placeholder.
Solution explanation
The value doesn't change - only how printf displays it.
Show solution
#include <stdio.h>
int main() {
int n = 255;
printf("%d %x %X %o\n", n, n, n, n);
return 0;
}