Test1 Class Revision - Exercice Chapter #2 1 What is the...

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: Exercice Chapter #2 1 What is the output of the following program? #include <iostream.h> void main ( ) { int x=1; for ( ; ; ) { if (x++ % 15 == 0) break; if (x % 5 != 0) continue; cout<< x << ; } } What is the output of the following program? #include <iostream.h> void main ( ) { int x=10; while ( x ) //>0 { if ( --x == 5 ) break; cout << x << ; } } What is the output of the following program? #include <iostream.h> void main ( ) { int x=10; while ( x ) //>0 cout<< --x << ; } What is the output of the following program? #include <iostream.h> void main ( ) { int j; for (j=1; j<=10; j++) { if (j>5 && j<=7) cout<< j <<endl; } cout<<endl; } Exercice Chapter #2 2 What is the output of the following program? #include <iostream.h> void main ( ) { int j; for (j=1; j<=10; j++) { if (j>5 || j<=7) cout<< j <<endl; } cout<<endl; } What is the output of the following program? #include <iostream.h> void main ( ) { int j; for (j=1; j<=10; j++) { if (j<5 || j>=7) cout<< j <<endl; }...
View Full Document

This note was uploaded on 01/27/2010 for the course DS csc 270 taught by Professor Dr.m.g during the Spring '10 term at Notre Dame University-Louaize.

Page1 / 5

Test1 Class Revision - Exercice Chapter #2 1 What is the...

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