Question: Assume that you correct for minor compile-time errors. The following code considers the impact of the size of some data types on programming. Given what

Assume that you correct for minor compile-time errors. The following code considers the impact of the size of some data types on programming. Given what you have learned, which statements are true for a modern computer?

  1. #include < iostream>
  2. using namespace std;
  3. int main() {
  4. int k, j = 2147483647;
  5. int i;
  6. float x = 1.0e27;
  7. double b
  8. j++;
  9. x *= 10;
  10. cout << "j = " << j << endl;
  11. cout << "k = " << k << endl;
  12. cout << "i = " << i << end1;
  13. cout << "x = " << x << endl;
  14. cout << "b = " << b < endl;
  15. return 0;
  16. }

Select one or more:

a. if j overflows on line 10 then line 12 will show that j is negative due to underflow.

b. j is uninitialized.

c. If the largest value of type float is on the order of 1.0e27 then line 15 will show that x is inf due to overflow on line 11.

d. If the largest value of type float is on the order of 1.0e27 then line 15 will show that x is negative due to overflow on line 11.

e. b is uninitialized.

f. k must hold the same value as j.

g. i is uninitialized.

h. if j overflows on line 10 then line 12 will show that j is negative due to overflow.

i. If the largest value of type double is on the order of 1.0e27 then line 16 will show that b is inf due to overlow on line 11.

Thank you !!!!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!