Tires don't have to have exactly the same pressure. Modify the program for exercise 2 so that the front tires can be within 3 psi of each other, and
the rear tires can be within 3 psi of each other.
Input right front pressure
35
Input left front pressure
37
Input right rear pressure
41
Input left rear pressure
44
Inflation is OK

I don't need the code..All I need is the formula in getting psi or whatever formulas I need to derive with this output. Thanks in advance..Any help or explanation is could be helpful.

the front tires can be within 3 psi of each other:

-3 <= (right front pressure - left front pressure) <= +3

back tyres ditto.