Midterm 1 Review Quiz 09

E

Info iconThis preview shows page 1. Sign up to view the full content.

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

Unformatted text preview: cout << }
 "Woof!"; 1);
 0; i < 2; i++) { i*2 << ' '; 
 
 Problem
2:
25
points.
 
 State
whether
each
segment
of
code
is
valid
C++.

If
it
is
not
valid
C++,
fix
it
so
that
it
 will
compile.

(Valid
C++
means
that
it
will
compile
without
errors.)
 (a) 
 int i; … if (i = 0) { cout << "Neigh!"; } 
 
 
 
 (b) 
 int i; … if (i <0 && > -2) { cout << "Oink! "; } 
 
...
View Full Document

This note was uploaded on 02/08/2014 for the course CS 115 taught by Professor Staff during the Fall '08 term at Sonoma.

Ask a homework question - tutors are online