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?
- #include < iostream>
- using namespace std;
- int main() {
- int k, j = 2147483647;
- int i;
- float x = 1.0e27;
- double b
- j++;
- x *= 10;
- cout << "j = " << j << endl;
- cout << "k = " << k << endl;
- cout << "i = " << i << end1;
- cout << "x = " << x << endl;
- cout << "b = " << b < endl;
- return 0;
- }
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started