CSC 17 Test 1 SPRING 1999

CSC 17 Test 1 SPRING 1999 - CSc 17 Test 1 19 February 1999...

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

View Full Document Right Arrow Icon
CSc 17 Test 1 19 February 1999 >>>>>>>>>>>>>>>>ANSWERS<<<<<<<<<<<<<<<<<<<<<<<<<< 1. (20 pts) State the value of each of the following expressions: a. 6+7/8 6 b. 6*7%8 2 c. 8.0+6/10 8.0 d. 8.0*6/10 4.8 e. int(char(95)-1) 94 f. 6*7/8 5 g. 2>3 && (4/(3-3) >5) false h. 8*(9/8)+9%8 9 i. !(true == false) == false false j. 'a'>'c' || 'A'<'C' true 2. (16 pts) Suppose we have the following functions prototypes and variable declaration: void func(int a, ifstream & b); void func(ifstream &a, int b); int gunc(int c); ifstream in; State whether each of the following function calls will compile. If a call does not compile explain why. a. func(2,in); COMPILE b. func(in,2); COMPILE c. func(in,in); MISMATCH OF PARAMS d. gunc(in); MISMATCH OF PARAM e. gunc(gunc(3)); COMPILE f. gunc(); TOO FEW PARAMS g. func(); TOO FEW PARAMS h. func(2+gunc(3), in); COMPILE 3. (14 pts) Suppose we have the following variable declarations and function definition: a=a+1; b=b*a; c=c+2; d=d*c;
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.

Page1 / 2

CSC 17 Test 1 SPRING 1999 - CSc 17 Test 1 19 February 1999...

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