For each of the following computations in C++, determine whether the result is exact, an overflow, or a roundoff error.
a.2.0 - 1.1
b.1.0E6 * 1.0E6
c.65536 * 65536
d.1000000 * 1000000
Write a program that prints the values
3 * 1000 * 1000 * 1000
3.0 * 1000 * 1000 * 1000
Write or snip the code here:
Snip the output here:
a) Exact result
b) exact result
c) Overflow
d) Overflow
CODE
#include <iostream>
using namespace std;
int main () {
cout << 3 * 1000 * 1000 * 1000 << endl;
cout << 3.0 * 1000 * 1000 * 1000 << endl;
}
OUTPUT
Get Answers For Free
Most questions answered within 1 hours.