chap 4 notes 45 - “MAX NUMBER ="<<maxNum return...

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

View Full Document Right Arrow Icon
45 A do-while Example #include <iostream> using namespace std; int main( void ) { int num, maxNum= 0 ; do { cout<< "Enter a number (0 to quit): " ; cin>>num; cout<< endl << endl; if (num>maxNum) maxNum=num; } while (num!= 0 ); cout<<
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: “MAX NUMBER = " <<maxNum; return ; } num maxNum ? 0 Notice that there is no condition at the start of the do-while loop. This is the difference between a do-while loop and a while loop....
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online