{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# hw2 - EME5 Homework 2(Problems 4-15 4(Ch 2 Problem 1 State...

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

EME5 Homework 2 (Problems 4-15) 4. (Ch. 2, Problem 1) State whether the following statement is true/false. If false, explain why. All variables in C must be declared before they are used. True 5. (Ch.2, Problem 2 c, d) Write the octal, decimal, and hexadecimal equivalents of the following binary numbers. c.) 0b01110111 octal equivalent: 0167 decimal equivalent: 119 hexadecimal equivalent: 0x77 d.) 0b00111101 octal equivalent: 075 decimal equivalent: 61 hexadecimal equivalent: 0x3D 6. (Ch.2, Problem 3 e, f) Find the binary representation for positive integers and binary two's complement representation for negative integers using 32 bits. e.) 64 binary representation: 0b 0000 0000 0000 0000 0000 0000 0100 0000 f.) -64 binary two's complement: 0b 1111 1111 1111 1111 1111 1111 1011 1111 Plus 1: +1 binary two's compliment representation: 0b 1111 1111 1111 1111 1111 1111 1100 0000 7. (Ch.2, Problem 6 a, b, g) Find the error(s) in the program segments. Explain how each error can be corrected. a.) printf(“%s\n”, 'Happy Birthday'); - double quotes (“ ”), not single (' '): printf(“%s\n”, “Happy Birthday”); b.) printf(“\%c\n”, 'Hello'); -

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 4

hw2 - EME5 Homework 2(Problems 4-15 4(Ch 2 Problem 1 State...

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

View Full Document
Ask a homework question - tutors are online