Advertisement
Guest User

Untitled

a guest
Jun 19th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1.  
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. int main() // Most important part of the program!
  7. {
  8. int age; // Need a variable...
  9.  
  10. cout<<"Please input your age: "; // Asks for age
  11. cin>> age; // The input is put in age
  12. cin.ignore(); // Throw away enter
  13. if ( age < 10 ) { // If the age is less than 100
  14. cout<<"You are pretty young!\n"; // Just to show you it works...
  15. }
  16. else if ( age < 50 ) { // I use else just to show an example
  17. cout<<"You are an Adult!\n"; // Just to show you it works...
  18. }
  19. else if { age < 100 ) (
  20. cout<<"You can recive Health Benifits!\n"; // Executed if no other statement is
  21. }
  22. else (
  23. cout<<"Get a Life!\n";
  24. )
  25. cin.get();
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement