MCQs>IT & Programming>C++>What is output of following program? #include <iostream> int main() { double x = 1.0; for(int i = 0; i < 3; ++i) x *= 0.1; std::cout << x * 1e3 - 1; }
C++ MCQs
What is output of following program? #include <iostream> int main() { double x = 1.0; for(int i = 0; i < 3; ++i) x *= 0.1; std::cout << x * 1e3 - 1; }
Answer
Correct Answer: It's depend of double implementation, usually not exactly zero.
Explanation:
Note: This Question is unanswered, help us to find answer for this one