Question: Overflow and Underflow Question 4) Create a new C++ file named: overAndUnder.cpp In the file create variable of data type short named largeNumber. Assign the
Overflow and Underflow
Question 4) Create a new C++ file named: overAndUnder.cpp
In the file create variable of data type short named largeNumber. Assign the value of 32767 to it. Create another short variable named lowNumber, assign the value of -32765 to it.
Display the value of the variable largeNumber.
Now display the value of the variable largeNumber +5.
What is the result? Answer:
Display the value of the variable lowNumber.
Now display the value of the variable lowNumber - 30.
What is the result? Answer:
Question 5) Assume that a certain fakeType data type holds values between 0 and 50.
Assume that we have one variable myNumber that holds the value of 48. What will be the values of the following?
fakeType newNumber = myNumber + 5;
fakeType anotherNumber = 4 10;
fakeType someNumber = myNumber + 20;
fakeType finalNumber = myNumber 60;
User input
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
