hw3_solution

hw3_solution - EME5 Homework 3 Solutions October 15, 2010 3...

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

View Full Document Right Arrow Icon
EME5 Homework 3 Solutions October 15, 2010 3 Chapter 4, Problem 1 3.1 Part a False. Some operators are operated from left to right and others are evaluated from right to left depending on their associativity. 4 Chapter 4, Problem 2 4.1 Part e a = (b >> (2 + 4)); 4.2 Part g (a == b) || (x != y) 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
5 Chapter 4, Problem 4 5.1 Solution Code #include <stdio.h> int main() { float f1 = 0.2, f2 = 0.5; printf("(f1 * f1 == 0.1) = %d\n", f1*f1 == 0.1); printf("(f1 + f1 == 0.07) = %d\n", f1+f1 == 0.07); return 0; } 5.2 Solution Output (f1*f1 == 0.1) = 0 (f1+f1 == 0.07) = 0 6 Chapter 4, Problem 11 6.1 Part a 4 3 πr 3 (1) 6.2 Part b 4 3 πr 3 (2) 6.3 Part c 9 5 c + 32 (3) 2
Background image of page 2
6.4 Part d 9 5 c + 32 (4) 7 Chapter 4, Problem 12 7.1 Part c (4/3.0)*3.14*r*r*r 7.2 Part f 7.3 Part i 8 Chapter 4, Problem 16 8.1 Part b 8.1.1 Solution Code #include <stdio.h> #include <math.h> int main() { /* declare and initialize variables */ double x1 = 4, y1 = 3, x2 = 6, y2 = 5; double sidex, sidey, distance; /* calculate the distances of two sides
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 8

hw3_solution - EME5 Homework 3 Solutions October 15, 2010 3...

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

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