fork download
  1. #include <iostream>
  2. #include <iomanip>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.  
  9. double n=0, x=0;
  10.  
  11. while (cin >> n >> x) //will keep going until an integer is not entered
  12. {
  13. cout << "You entered the two integers " << setprecision(20) << x << " and " << n << endl;
  14.  
  15. if (x-n <= (1.0/10000000) && n-x <= (1.0/10000000))
  16. cout << "The numbers are almost equal" << endl;
  17. }
  18.  
  19. return 0;
  20.  
  21. }
Success #stdin #stdout 0.01s 2816KB
stdin
29999999 29999998
stdout
You entered the two integers 29999998 and 29999999