sample_midterm_questions

sample_midterm_questions - CGS 3460 Fall 2009 Midterm Form...

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

View Full Document Right Arrow Icon
CGS 3460 Fall 2009 Midterm – Form A Name___________________________ Instructor: Neko Fisher UFID___________________________ All questions in this exam pertain to the C99 standard.  You may assume that all  proper header files needed for a piece of code are included.  In order for your  exam to be graded, you must agree, and sign the following: "On my honor, I have neither given nor received unauthorized aid in doing this  exam." Name(print)____________________________    Signature______________________________ Short Answer (Programs referencing  “Fragment n”  are at the end of the section) 1. Which of the following are NOT key words according to the C99 standard? (4  points) A) if B) boolean C) for D) While E) do F) class G) int 2. Which of the following are NOT C ARITHMETIC operators.  (4 Points) A) + B) /*. ..*/ C) - D) || E) ^ F) # G) << I) % J) * 3. Give the name of a program discussed and shown in class which can be used  for debugging programs compiled with gcc. (4 points) 4. Write a SINGLE call to printf, that displays a floating point variable  called “f” in fixed decimal notation, right justified, with 3 digits printed  after the decimal point in a field of size 20. (4 points) 5. Write a SINGLE call to scanf that would read the 10 into an integer variable  called “x”, the 20 into an integer variable called “y” and the 30 into an  integer variable called z, if the following input was given by the user,  where <\n> is the user pressing the enter key. (4 points) User Input: “10|20|30<\n>”. 1/15
Background image of page 1

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

View Full DocumentRight Arrow Icon
CGS 3460 Fall 2009 Midterm – Form A Name___________________________ Instructor: Neko Fisher UFID___________________________ 6. What would be the output of  Fragment 1 (4 Points) 7. Knowing the decimal ASCII value of the letter 'A' is 65 and the decimal  ASCII value of 'Z' is 90, and you are given the following declarations char c = 'F';                         short s = 12; int i = 7;                            long m = 3; float f = 9.8;                        double d = 102.0; Give the VALUE and TYPE of each expression listed below  (2 Points each) A) c * m; B) s + d; C) f / i; D) d / s; E) f – d; F) (int) f; 8. What would be the output of the program in  Fragment 2 ? (4 points) 9. fun3 is entirely too complicated.  Simplify and rewrite the function in  Fragment 3  so that it contains a single return statement.    (You will need to  use logical operators.) (4 points) 10. What would be the output of the program in 
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 07/08/2011 for the course CGS 3460 taught by Professor Staff during the Summer '08 term at University of Florida.

Page1 / 15

sample_midterm_questions - CGS 3460 Fall 2009 Midterm Form...

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

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