Midterm 1 Review Quiz 08

D

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: it
 will
compile.
 (a) 
 int i; … if (i = 0) { cout << “Neigh!”; } 
 
 
 
 (b) 
 int i; … if (i <0 && > -2) { cout << “Oink!”; } 
 
 
 
 
 (c) 
 for (int i=5; i >= 0; i --) { cout << “Meow!” }
 
 
 
 
 (d) 
 int i; … if (i > 0) { cout << “Positive!”; } else if (i < 0) { cout << “Negative!”; } else (i ==0) { cout << “Zero!”; }
 
 
 
 
 
 (e) 
 while (true) { cout << “Cocorico!” <&l...
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