Examveda

What will be the output of the following C++ code?
#include <iomanip>
#include <iostream>
using namespace std;
int main()
{
    cout << setprecision(17);
    double d = 0.1;
    cout << d << endl;
    return 0;
}

A. 0.11

B. 0.10000000000000001

C. 0.100001

D. compile time error

Answer: Option B


Join The Discussion

Related Questions on Variables and Data Types in C plus plus