Question: Section 1: Syntax Write ONLY the statements requested and required. 1) Write the function definition of the function named negation() that takes an int parameter

Section 1: Syntax Write ONLY the statements requested and required. 1) Write the function definition of the function named negation() that takes an int parameter named n, and returns an int. It returns positive n if n is negative, negative n if n is positive, or 0 if n is zero. 2) Given int variable, r, that had been initialized, write a statement(s) that displays 2 if z is a multiple of 2, 3 if z is a multiple of 3, 6 if r is a multiple of both 2 and 3, or otherwise I 3) Write the function definition of the function named concatenate() that takes two string parameters named frst and send respectively and returns a string. It should return the first parameter concatenated to the end of the second parameter 4) Given float variables, a, b and emphc, that had been initialized, write a statement(s) that displays the minimum of the variables 5) Write the function definition of the function named distance ) that takes teo int parametens and returns an int. It should return the distance between the parameters 6) Given int variable, s, that had been initialized, write a statement (s) that displays "To" if s is a multiple of 3, "Fro" if s is a multiple of 5, or To Fro if it is a multiple of 15. 7) Write the function definition of the function named piecevise ) that takes an int named n as a parameter and returns an int. It should return five more than n if it is non-negative; otherwise, it returns one less than the square of n. 8) Write the function prototype of the function named perimeter that takes five double and a double reference as parameters, and it returns nothing
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
