Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int age = 14, height = 170;
- test1(age, height);
- printf("---------------");
- test2(age, height);
- getchar();
- return 0;
- }
- void test1(int age, int height)
- {
- if (age < 15 && height > 175)
- {
- printf("You should play basketball\n");
- }
- else if(age > 15 && height > 175)
- {
- printf("You should play basketball!\n");
- }
- else
- {
- printf("Are you a soccer player?\n");
- }
- }
- void test2(int age, int height)
- {
- if(age < 15)
- {
- if(age > 175)
- {
- printf("You should player basketball\n");
- }
- }
- else
- {
- if(height > 185)
- {
- printf("You should play basketball!\n");
- }
- else
- {
- printf("Are you a soccer player?\n");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement