Trace the following programs and tell what each will display. (Some require a calculator.)
A) (Assume the user enters 38711. Use a calculator.)
#include
using namespace std;
int main()
{
double salary, monthly;
cout << "What is your annual salary? ";
cin >> salary;
monthly = static_cast
cout << "Your monthly wages are " << monthly << endl;
return 0;
}
B) #include
using namespace std;
int main()
{
long x, y, z;
x = y = z = 4;
x += 2;
y -= 1;
z *= 3;
cout << x << " " << y << " " << z << endl;
return 0;
}
C) #include
using namespace std;
#define WHO "Columbus"
#define DID "sailed"
#define WHAT "the ocean blue."
int main()
{
const int WHEN = 1492;
cout << "In " << WHEN << " " << WHO << " "
<< DID << " " << WHAT << endl;
return 0;
}
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.