Boolean7. Three integers are given: A, B, C. Check the truth of the statement: "The number B is between the numbers A and C".

Solution in Python 3:

import random
A = random.randrange(-10,10)
B = random.randrange(-6,6)
C = random.randrange(-10,10)
print("A = ", A)
print("B = ", B)
print("ะก = ", C)
x = ((A<B) and (B<C)) or ((C<B) and (B<A))
print("B is between the numbers A and C: ", x)

Solution in C++:

#include <iostream>
using namespace std;
int main(){
int a, b, c;
cout << "Enter the number A: ";
cin >> a;
cout << "Enter the number B: ";
cin >> b;
cout << "Enter the number C: ";
cin >> c;
cout << "B is between A and C: " << ((a<b && b<c)||(c<b && b<a)) << "." << endl;
return 0;
}