Question: int main(){ int x = 200, y = 119; double a = 3.4, b = 5.6; cout < < difference(a+1, b) < < endl; //
int main(){ int x = 200, y = 119; double a = 3.4, b = 5.6; cout << difference(a+1, b) << endl; // prints: 1.2 if (isPrime(y)) printNum(y); //prints out y if y is a prime number if (triple(a) > b ) cout << triple(a) << endl; //triple(a) returns the triple of the parameter value return magic(magic(x, 3), y); } Exercise: 1. Write the function difference which was called in the above main function 2. Write a function called isPerfect which takes one integer parameter and return true if the parameter is a perfect number, return false other wise. A perfect number is a number that it's factors (from 1 up to itself but not including itself) add up equal to itself. isPerfect(6) will return ture. 3. Write a function called max3 that takes three double values as parameters and return the bigger one out of three. Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
