Ch2_4_s5 - cin>> variable1 or cout<<"Enter...

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

View Full Document Right Arrow Icon
Chapter 2.4: Input/Output 1 Next Slide Previous Slide Prompting for keyboard data To know what data to enter from the keyboard, a program will use a cout statement to "prompt" (i.e. ask) for the data, followed by a cin statement for input of the data. For example: cout << "Please enter variable1 here: “
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ; cin >> variable1 ; or cout << "Enter your age and weight, separated by a space : “ ; cin >> age >> weight ; or cout << "Enter your age and weight\n\nAge = “ << endl ; cin >> age ; cout << "Weight = “ ; cin >> weight ;...
View Full Document

This note was uploaded on 05/19/2008 for the course ENGR 25 taught by Professor All during the Spring '08 term at Lehigh University .

Ask a homework question - tutors are online