Suppose that num is an int variable. Consider the following C++ code. cin >> num; if (num >= 0) switch (num % 3) { case 0: num--; break; case 1: ++num; break; case 2: num = static_cast(pow(num, 3.0));...


Suppose that num is an int variable. Consider the following C++ code.
cin >> num;
if (num >= 0)
switch (num % 3)
{
case 0:
num--;
break;
case 1:
++num;
break;
case 2:
num = static_cast(pow(num, 3.0));
break;
}


else
{
num = -num;
num = static_cast(sqrt(num * 1.0));
}
cout < num=""><>
a. What is the output if the input is 7?
b. What is the output if the input is 23?
c. What is the output if the input is 20?
d. What is the output if the input is -9?



Jun 02, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here