SHARE
TWEET

Untitled

a guest Oct 19th, 2019 109 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void function(int);
  5.  
  6. int main()
  7. {
  8.     int a;
  9.     cout<<"age:";
  10.     cin>>a;
  11.     function(a);
  12.     system("pause");
  13.     return 0;
  14. }
  15.  
  16. void function(int age)
  17. {
  18.     if(age == 0  || age == 1){
  19.         cout<<"Baby"<<endl;
  20.     } else if (age >=1 && age <= 3){
  21.         cout<<"Toddler"<<endl;
  22.     } else if (age >=3 && age <= 5){
  23.         cout<<"Preschool"<<endl;
  24.     } else if (age >=5 && age <= 12){
  25.         cout<<"Gradeschooler"<<endl;
  26.     } else if (age >=13 && age <= 18){
  27.         cout<<"Teen"<<endl;
  28.     } else if (age >=18 && age <= 21){
  29.         cout<<"Young Adult"<<endl;
  30.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top