chap 4 notes 60 - } while (sum<= 20 ) return ; } num sum...

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

View Full Document Right Arrow Icon
60 Another do-while Example #include <iostream> using namespace std; int main( void ) { int num= 0 , sum= 0 ; do { num++; cout<< "SUM= " << sum << endl << endl; sum+=num;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } while (sum<= 20 ) return ; } num sum 3 6 Condition is checked again. sum is still less than 20, so the loop is executed again....
View Full Document

This note was uploaded on 11/16/2011 for the course COP 2271 taught by Professor Staff during the Fall '11 term at University of Florida.

Ask a homework question - tutors are online