jeudi 18 mars 2021

Not really familiar with this language just helping a friend by googling stuff. Cannot understand what is wrong [closed]

#include <iostream>
#include <cmath>
#include <iomanip>
#include <cstdlib>
using namespace std;

int main()
{
int z, q;


cout << "Introdu valoarea lui z:\n"; cin >> z;
cout << "Introdu valoarea lui q:\n"; cin >> q;
z = abs(z);
q = abs(q);
if (z < 6 && q > 3,14) {
    cout << z << " ∈ ( 0 ; 6 )\n";
    cout << q << " ∈ ( 3.14 ; +∞ )";
}
else {
    cout << z << " ∉ ( 0 ; 6 )\n";
    cout << q << " ∉ ( 3.14 ; +∞ )";
}
}

When I run it everytime the condition is true no matter what values I input. I have no idea what to do, no errors nothing just true every time, I input 7 as z and 2 as y both false and the output is still true.


Aucun commentaire:

Enregistrer un commentaire