{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Test1 Class Revision

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

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

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; }

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

View Full Document
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; } 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; } cout<<endl; } What is the output of the following program?
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}