#include <iostream> using namespace std; int main() { double input1=0.00; double input2=0.00; bool input=true; cout<<"Please enter first number"<<std::endl; cin>>input1; cout<<"Please enter second number"<<std::endl; cin>>input2; double input_diff=input1-input2; cout<<"input difference is "<<input_diff<<endl;
if (input_diff > -2.0 & < 2.0){ // What is wrong here? x=true; cout<<"The value between the two is almost equal"<<endl; } }
(input_diff > -2.0) & (input_diff < 2.0)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)