Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

(a) write the definition for a void function larger that takes two interger argu

ID: 3652382 • Letter: #

Question

(a) write the definition for a void function larger that takes two interger arguments value1 and value2 and swaps their values if value1 is greater than value2. (b) write a main function definition that obtains two integer input value from the console and print them out in increasing order (smaller value first, larger value second). Do not use any control statement(if-else) refer using the function from part (a) to re arrange the parameters in porper order. (c) write the definition for a function names even that takes a single integer argument and return true if the value if even, false otherwise.

Explanation / Answer

(a) void larger(int& value1, int & value2) { if(value1>value2) { int temp=value1; value1=value2; value2=temp; } } (b) int main() { int value1,value2; coutvalue1; coutvalue2; larger(value1,value2); cout