ECE-1011 (SPRING 2003)

QUIZ #2 PREP SHEET

 

(p60) Which header file must be included in your program in order to use printf() or scanf()?

(p61) Write the conversion specifier that would be used to print out a variable of type double such that it had at least two blank spaces before the number, the number always took an additional four spaces for the digits left of the decimal point and printed out three digits to the right of the decimal point?

(p61) How do you tell printf() to left justify a particular value?

(p61) How do you tell printf() that you want always print the appropriate sign (positive or negative) before the number?

(p62) How do you print out characters such as a backslash or double quote?

(p62) The function printf() returns a value. What does that value represent?

(p63) What is the conversion specifier for a variable of type double for scanf()? What is it for printf()?

(p64) What does the ampersand, '&', prefix do to a variable identifier and why is that (frequently) needed with scanf()?

(p65) If the forward CG limit of an airplane is 39 inches at a gross weight of 2100 pounds and it moves linearly back to 43 inches at a gross weight of 2900 pounds, what is the forward limit at a weight of 2600 pounds? At what weight is the forward limit 41.5 inches?

(p65) Using the data from the prior question, write an equation that gives the forward CG limit as a function of weight and another that gives the weight at which the forward CG limit is a particular value.

(p74) Which header file must be included in your program in order to access most of the mathematical functions?

(p75) (corrected) The statement, "compute the base b logarithm of x" means that you are looking for the value y such that x = by. Using functions found in the standard math library, write a statement that uses b and x (previously declared and initialized variables of type double) to store the base b logarithm of x into the variable y (again, y has been previously declared as a variable of type double).

(p77) Why does the Standard C Library include the function atan2() in addition to atan()?

(p81) Which of the following statements is incorrect regarding the character comparison functions found in the Standard C Library?

  1. If the result of the comparison is false, a zero (0) is returned.
  2. If the result of the comparison is true, a one (1) is returned.
  3. No change is made to the value stored in the variable used in the comparison.
  4. Each function requires an integer argument and each function returns an integer argument.

(p87) (T/F) The limitations on the values that can be represented by variables of various types is defined by the ANSI C Language Standard to ensure that ANSI-compliant code will run properly when compiled on different operating systems?

(p87) Explain what information the DBL_EPSILON value defined in float.h provides to you.