Number Bases

Lab C Beginner 10 points

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
Sample output available
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;
}
Output
Answer
HOME LEARN COMMUNITY DASHBOARD