







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Exam; Professor: Ruttan; Class: INTRODUCTION TO COMPUTER PROGRAMMING; Subject: Computer Science; University: Kent State University; Term: Unknown 1989;
Typology: Exams
1 / 13
This page cannot be seen from the preview
Don't miss anything!








int num1 = 3; int num2; cin >> num2; if ( num2 / num1 == 1 ) cout << "first option" << endl; else cout << "second option" << endl;
int x; int y; cin >> x; cin >> y; cout << y; cout << x << endl;
b) 2 1 c) 2 1 d) 21
b) #include
b) 5 < x < 10 c) 5 <= x && x <= 9 d) 5 <= x || x <= 9
cin >> color; if ((color == 0) && (color == 1)) cout << "red "; else if (color > 0) && (color < 2) cout << "blue "; else if (color <3) cout << "green "; else cout << "yellow "; cout << endl;
b) green c) yellow
int product( int& num1, int num2 ) { int num3; num3=num1; num1=num2; return( num3 * num2 ); }
b) The first parameter should be a variable c) The second parameter should be a variable d) Both parameters should be variables
#include
b) 7 35 c) 35 7 d) 1 2
#include
b) 1.022. c) 2.012. d) 122