unknown program

unknown program - .. } else if ( age == 100 ) { // I use...

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

View Full Document Right Arrow Icon
#include <iostream> using namespace std; int main() // Most important part of the program! { int age; // Need a variable. .. cout<<"Please input your age: "; // Asks for age cin>> age; // The input is put in age cin.ignore(); // Throw away enter if ( age < 100 ) { // If the age is less than 100 cout<<"You are pretty young!\n"; // Just to show you it works.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: .. } else if ( age == 100 ) { // I use else just to show an example cout&lt;&lt;&quot;You are old\n&quot;; // Just to show you it works. .. } else { cout&lt;&lt;&quot;You are really old\n&quot;; // Executed if no other statement is } cin.get(); }...
View Full Document

Ask a homework question - tutors are online