Z coutguessthealphabetbetweenatoz cinc trynumtrynum1

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: um , maxTries ; tryNum = 1 ; maxTries = 5 ; cout << "Guess the alphabet between a to z “ ; cin >> c ; while ( ( tryNum <= maxTries ) && ( c! = ‘z‘ ) ) { cout << "Guess the alphabet between a to z “ ; cin >> c ; tryNum = tryNum + 1 ; } for Loop For loop for ( initialization condition ; termination condition ; increment condition ) { statement ( s ) ; } Example int counter ; for( counter = 0 ; counter < 10 ; counter = counter + 1 ) cout << counter; cout Output 0123456789 Table for 2 2 x 1 = 2 2 x 2 = 4 2 x 3 = 6 : : 2 x 10 = 20 Example ­ Calculate Table for 2...
View Full Document

This note was uploaded on 01/12/2010 for the course CS CS 201 taught by Professor Dr.naveedmalik during the Spring '09 term at Virtual University of Pakistan.

Ask a homework question - tutors are online