[Solved] Why is my output in the form of 1.79214e-307 instead of a normal floating point number? [closed]


You are printing the wrong variable.

    notmemtot = totalnot(servcharge, testcharge, medcharge);
    cout << "The total bill is $" << membertot;

should be

    notmemtot = totalnot(servcharge, testcharge, medcharge);
    cout << "The total bill is $" << notmemtot;

But even easier (so you can’t make the mistake you made) would be not to use a variable in the first place, just write it like this

    cout << "The total bill is $" << totalnot(servcharge, testcharge, medcharge);

You don’t have to use variables when you use cout, you can just use the function result directly.

1

solved Why is my output in the form of 1.79214e-307 instead of a normal floating point number? [closed]