midterm_key - COP 3275 Fall 2011 Mid-term exam solution...

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

View Full Document Right Arrow Icon
COP 3275 Fall 2011 Mid-term exam solution Problem 1: (a) (by Radhika) Any two out of three of the following points qualify as the right answer. 1. Headers are definitions that are needed to invoke libraries and system calls. 2. It is an interface between the source files that are needed for the program. 3. A preprocessor directive is used before a header file - #include Also, to be added to the answer are examples of headers – specifically: #include<stdio.h> and its importance. (b) (by Min) Variables must be declared before they can be used (2 points) . Declarations are the statements which specify the type (1.5points) and name (1.5 points) of variables. Problem 2: (by Radhika) The output should be: 12.300000 - x (4 points) 45 - i (4 points) 0.600000 - y (2 points) If you run the given code, you observe that since the value of ‘i’ should be an integer and not float, the value stored in variable ‘i’ is 45, and then for ‘y’ it is 0.600000, since scanf considers that to be the next input. If the correct number of digits have not been put after the decimal point, – 1 mark has been
Background image of page 1

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

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

This note was uploaded on 11/30/2011 for the course COP 3275 taught by Professor Jonathanliu during the Fall '11 term at University of Florida.

Page1 / 2

midterm_key - COP 3275 Fall 2011 Mid-term exam solution...

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

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