Advertisement
Yonka2019

Untitled

Dec 5th, 2020
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.86 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     int age = 14, height = 170;
  6.     test1(age, height);
  7.     printf("---------------");
  8.     test2(age, height);
  9.  
  10.     getchar();
  11.     return 0;
  12. }
  13. void test1(int age, int height)
  14. {
  15.     if (age < 15 && height > 175)
  16.     {
  17.         printf("You should play basketball\n");
  18.     }
  19.     else if(age > 15 && height > 175)
  20.     {
  21.         printf("You should play basketball!\n");
  22.     }
  23.     else
  24.     {
  25.         printf("Are you a soccer player?\n");
  26.     }
  27. }
  28. void test2(int age, int height)
  29. {
  30.     if(age < 15)
  31.     {
  32.         if(age > 175)
  33.         {
  34.             printf("You should player basketball\n");
  35.         }
  36.     }
  37.     else
  38.     {
  39.         if(height > 185)
  40.         {
  41.             printf("You should play basketball!\n");
  42.         }
  43.         else
  44.         {
  45.             printf("Are you a soccer player?\n");
  46.         }
  47.     }
  48. }
  49.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement