This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: argument and returns a double value. 4. (10 pts) Write a whole C function named greatest that takes three int arguments, and returns the greatest of the three values. Remember there is no built-in function max in the C language, but you may write one as a helper function if you want. 5. (5 pts) Write an expression that will set the double variable x to a random value between -2.0 and +2.0, inclusive. double x = _________________________________________________________; 6. (5 pts) The text stresses the importance of surrounding macro parameters in parentheses when the macro uses them in an expression. For instance, here is a macro that multiplies its two parameters: #define MULT(x,y) ((x)*(y)) Explain - including an explicit example - why the parentheses are so important around each of x and y in the expression (x)*(y). End of LabHW5...
View Full Document
- Spring '11