Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void function(int);
- int main()
- {
- int a;
- cout<<"age:";
- cin>>a;
- function(a);
- system("pause");
- return 0;
- }
- void function(int age)
- {
- if(age == 0 || age == 1){
- cout<<"Baby"<<endl;
- } else if (age >=1 && age <= 3){
- cout<<"Toddler"<<endl;
- } else if (age >=3 && age <= 5){
- cout<<"Preschool"<<endl;
- } else if (age >=5 && age <= 12){
- cout<<"Gradeschooler"<<endl;
- } else if (age >=13 && age <= 18){
- cout<<"Teen"<<endl;
- } else if (age >=18 && age <= 21){
- cout<<"Young Adult"<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement