-
What is the output of this program?
#include
#include
using namespace std;
int main()
{
cout << setprecision(17);
double n = 0.2;
cout << n << endl;
return 0;
}
-
- 0.20000000000000001
- 0.2000000001
- 0.200
- 2.20000000000000001
- None of these
Correct Option: A
The double had to truncate the approximation to its limited memory, which resulted in a number that is not exactly 0.2.