c17su99t1

c17su99t1 - CSc 17 Test 1 1. Thursday 10 June 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 Thursday 10 June 1999 ###########ANSWERS#################### 1. (10 pts)Given the function definitions below, state what output is generated by the code below the dashed line. {y++; x+=y; cout <<x<<" "<<y<<" "; } void a(int & x, int& y,int z) { x=y+z; y=y+z; b(x,z); cout << x << " " << y << " " << z<<endl; } ----------------------------------------------------------- int u=1,v=2,w=3; //9 4 9 5 4 a(u,v,w); //9 5 3 cout << u << " " << v << " " << w << endl; //8 8 w=3; b(w,w); 2. (10 pts) In the code below find 10 syntax errors and no more. I will only grade the first 10 syntax errors you identify. Note that I have not provide definitions for all the functions, but that will not generate a syntax error, rather, if the code compiles, it will generate a linker error, because the definition(s) cannot be found. #include <fstream.h> void func(int a, bool b) // MISSING ; int b(ifstream in) // MISSING ; void main { // MISSING () AFTER main
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 / 3

c17su99t1 - CSc 17 Test 1 1. Thursday 10 June 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