[Solved] Oyegun Augustine Csc110 4 21 19 Program Take Two Numbers User State Whether Equal Includ Q37177798
// Oyegun A. Augustine, CSC110, 4/21/19
//A program that will take two numbers from user and state whetherthey are equal or not.
#include <iostream>
using namespace std;
bool TestEqual(int x, int y) {
return x == y;
}
int main() {
//Declare variables
cout << “TestEqual num1, num2” << endl;
int x;
//Prompt user for first number
cout << “Enter num1: “;
cin >> x;
cout << “” << endl;
int y;
//Prompt user for second number
cout << “Enter num2: “;
cin >> y;
//Output
if (TestEqual(x, y)) {
cout << “The two numbers are equal” << endl;
} else {
cout << “The two numbers are not equal” << endl;
}
}
- Q: If you changed one of the variable valuesin your function, would it change the value of the variable inmain? Why?
- Q: What are the two options for passingparameters into a function? (by _________ and by__________) What’s the difference?
- Write a new function, MakeEqual, that takestwo integers and if they are not equal (tested using yourTestEqual function), displays a message and setsthe first parameter to have the same value as the second parameter.Update main so that after prompting the user fortwo numbers it calls MakeEqual and thendisplay the variables.
Submit: Commented code
Expert Answer
Answer to // Oyegun A. Augustine, CSC110, 4/21/19 //A program that will take two numbers from user and state whether they are equa… . . .
OR

