q2 sol - CSCI.1100 Computer Science I Quiz 2 Closed book...

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

View Full Document Right Arrow Icon
CSCI.1100 Computer Science I Quiz 2 September 20, 2007 Closed book, closed notes, no computers or calculators of any kind. Name: RCS login: Circle your lab section: (01 MTh 10:00) (02 MTh 12:00) (03 MTh 2:00) (04 MTh 4:00) (05 MTh 6:00) (06 MR 10:00) (07 TF 10:00) (08 TF 12:00) (09 MR 12:00) (010 TF 2:00) You will have 15 minutes to complete this test. Make sure you do not spend too much time on any question. The time spent on each question should be proportional to the number of points 1. What will this program print (10 points)? #include <iostream> using namespace std; int main() { int n1=5, n2=6, n3=10; n3 = n1 + n2; n1++; cout << n3 << endl; //___11___ cout << ++n1 << endl; //___7___ cout << n1++ << endl; //___7___ n1 = 0; n2 = n1++; n3 = n2 + 1; cout << n1 << endl; //___1___ cout << n2 << endl; //___0___
Background image of page 1

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

View Full DocumentRight Arrow Icon
cout << n3 << endl; //___1___ cout << 10 % 3 << endl; //___1___ cout << 10 / 3 << endl; //___3___ cout << 10.0 / 3 << endl; //__3.33 // any precision OK n1 = 100; n2 = 9; n3 = n1 - n2 % 3 * 2;
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 04/10/2008 for the course CSCI 1100 taught by Professor Hardwick during the Spring '08 term at Rensselaer Polytechnic Institute.

Page1 / 3

q2 sol - CSCI.1100 Computer Science I Quiz 2 Closed book...

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