Assume you have an int variable x that has been declared and initialized. Assume
ID: 3655812 • Letter: A
Question
Assume you have an int variable x that has been declared and initialized. Assume the existence of a function named tripled . This function receives an integer and returns three times its value. So, pass tripled 12 and it will return 36. DO NOT DEFINE this function-- just assume it is available. What you must do here is write an expression whose value is twenty-seven times x. In this expression do NOT use any integer literals (like 27) or arithmetic operations (like *). Instead, just use x and function calls to tripled .Explanation / Answer
return tripled( tripled( tripled( x ) ) );
Since 27 is x3, if you triple something 3 times, you'll effectively multiply it by 27.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.