Discussion Notes 2

Discussion Notes 2 - EME 5 Discussion 2 Base conversions...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
EME 5 Discussion 2 Base conversions for integers Binary representation for positive and negative integers printf() and scanf() statements Example problem for input and output Examples for operator precedence and associativity Examples for operators
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Base Conversions for Integers Find the decimal, octal, and hexadecimal values of the following binary numbers. 0b00110011 51 (decimal), 063 (octal), 0x33 (hexadecimal) 0b11111011 (two's complement notation) -5 (decimal), 0373, 0xFB
Background image of page 2
Binary Representation for Integers Find the binary values of the following integers using 8 bits. 28 0b00011100 -28 0b11100100
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
printf() and scanf() statements Correct the errors in the following statements. printf(“%c\n”, “This is a string); -> printf(“%s\n”, “This is a string”); Does this statement print out “Hello”? printf(““%s””, “Hello”); -> printf(“%s”, “Hello”); (output is Hello) -> printf(“\”%s\””, “Hello”); (output is “Hello”)
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 9

Discussion Notes 2 - EME 5 Discussion 2 Base conversions...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online