Nowy kurs! Każdy programista powinien nauczyć się Generative AI!
Wypróbuj darmową lekcję0
Please what is wrong with my code... It is printing Out Ok when the temperature is greater than 36.9
#include <iostream> using namespace std; int main() { //your code goes here float temperature; cin>>temperature; if(36.1<= temperature <=36.9){ cout<<"OK"<<endl; } else{ cout<<"Not OK"<<endl; } }
1 Odpowiedź
+ 3
condition is wrong
Use && to compare
Examples:
a && b
a < 0 && b > 0
a > 0 && b < 0