Discussion Notes 2

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

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

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

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

View Full Document
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
Binary Representation for Integers Find the binary values of the following integers using 8 bits. 28 0b00011100 -28 0b11100100

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

View Full Document
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”)
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### 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
Ask a homework question - tutors are online