Advertisement
Guest User

Untitled

a guest
Feb 25th, 2020
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4.  
  5. int isIncluded(int x, int a, int b);
  6.  
  7.  
  8. int main()
  9. {
  10. int IsIncluded = isIncluded(2, 3, 6);
  11.  
  12. if (IsIncluded == 1)
  13. {
  14. puts("X is included in [a, b]");
  15. }
  16. else
  17. {
  18. puts("X is not included in [a, b]");
  19. }
  20.  
  21. system("pause");
  22.  
  23. return 0;
  24. }
  25.  
  26. int isIncluded(int x, int a, int b)
  27. {
  28. if ( (x <= b) && (x >= a))
  29. {
  30. return 1;
  31. }
  32. else
  33. {
  34. return 0;
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement