qz2_ver2_sol

qz2_ver2_sol - UCR CS010: Winter 2004 Introduction to...

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

View Full Document Right Arrow Icon

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

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

Unformatted text preview: UCR CS010: Winter 2004 Introduction to Computer Science I Kris Miller Quiz 2: Lecture Sections 003 1. Which is the most probable output of the following code fragment? int first = 15, second = 20, third = 25; cout << “1:\t” << first << “\n2:\t” << second << “\n3:\t” << third; a. 1:\t 15 \n2:\t 20 \n3:\t 25 b. 1:\t first \n2:\t second \n3:\t third c. 1: 15 2: 20 3: 25 d. 1: first 2: second 3: third e. 1: 15 2: 20 3: 30 f. 1: 15 2: 20 3: 25 2. In the following complete program, which statement has a syntax error? #include <iostream> using namespace std; int main() { int ten = 10; double twenty = 20.0; bool yes = true; char no = ‘no’; cout << ten << twenty << no << yes << endl; return 0; } a. int ten = 10; b. double twenty = 20.0; c. bool yes = true; d. char no = ‘no’; e. cout << ten << twenty << no << yes << endl; 1 3. Which C++ expression is equivalent to the following math formula?...
View Full Document

This document was uploaded on 04/02/2012.

Page1 / 4

qz2_ver2_sol - UCR CS010: Winter 2004 Introduction to...

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