Ch2_4_s11 - cin>> age>> weight stats<<...

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 Example statements for text file output 1. ofstream output ( "data.txt“ ) ; variable1 = 6 ; cout << "variable1 = " << variable1 << endl ; output << "variable1 = " << variable1 << endl ; 2. ofstream stats ( "age_weight.txt“ ) ; cout << "Enter your age and weight: “ ;
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 >> age >> weight ; stats << age << " " << weight << end l; 3. ofstream out ( "information.txt“ ) ; cout << "Enter your age and weight\nAge = “ ; cin >> age ; cout << "Weight = “ ; cin >> weight ; out << "Your age: " << age ; out << "\nYou weight: " << weight << " pounds" << endl ;...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online