Question: 1 . Write a C + + program that does the following: a . Create a C + + file with the name problem 4

1. Write a C++ program that does the following:
a. Create a C++ file with the name problem4.cpp.
b. Write the function areVeryDifferentwhich determines whether the two integer parameters are very different if they differ by more than 10.
c. Type in the following main function into your C++ program file:
int main()
{
int x =4, y =10, z =-4;
if (areVeryDifferent(x, y))
cout <<"x and y are very different." << endl;
if (areVeryDifferent(x, z))
cout <<"x and z are very different." << endl;
if (areVeryDifferent(y, z))
cout <<"y and z are very different." << endl;
return 0;
}
d. The output from this program is:
y and z are very different.

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 Programming Questions!