Department of Computer Science | Institute of Theoretical Computer Science | CADMO

Theory of Combinatorial Algorithms

Prof. Emo Welzl and Prof. Bernd Gärtner

// Program: diff.cpp // Check subtraction of two floating point numbers #include int main() { // Input float n1; std::cout << "First number =? "; std::cin >> n1; float n2; std::cout << "Second number =? "; std::cin >> n2; float d; std::cout << "Their difference =? "; std::cin >> d; // Computation and output std::cout << "Computed difference - input difference = " << n1 - n2 - d << ".\n"; return 0; }