Boolean4. Two integers are given: A, B. Check the truth of the statement: "The inequalities \(A>2\) and \(B \leq 3 \) are true."

Solution in Python 3:

import random
A = random.randrange(-10,10)
B = random.randrange(-10,10)
print("A = ", A)
print("B = ", B)
x = (A>2) and (B<=3)
print("A > 2: ", (A>2))
print("B <=3: ", (B<=3))
print("A > 2 and B <= 3: ", x)

Solution in C++:

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