Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int isIncluded(int x, int a, int b);
- int main()
- {
- int IsIncluded = isIncluded(2, 3, 6);
- if (IsIncluded == 1)
- {
- puts("X is included in [a, b]");
- }
- else
- {
- puts("X is not included in [a, b]");
- }
- system("pause");
- return 0;
- }
- int isIncluded(int x, int a, int b)
- {
- if ( (x <= b) && (x >= a))
- {
- return 1;
- }
- else
- {
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement