Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement