Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started