Practice mode C Language

What is printed by this C code: printf(“%x %o”, 255, 8);?

Correct answer D. ff 10

Explanation

%x prints an unsigned value in hexadecimal using lower-case letters, so 255 becomes ff, and %X would give FF. %o prints in octal, where 8 is written as 10 (one eight and zero units). Neither adds a prefix such as 0x or 0 unless the # flag is used, as in %#x, which would print 0xff.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.