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

uestion 17 (6 marks): Please read the constraints carefully. No marks will be a

ID: 3891868 • Letter: U

Question

uestion 17 (6 marks): Please read the constraints carefully. No marks will be a the requirements are not followed. warded if Below, you are to complete a main function, preceded by a void function (no return statement) named moose. moose adds three INTEGER values to produce their sum. The function moose may have only THREE parameters, the FIRST and THIRD of which, named buffalo and other, must be of type int. The function has only a SINGLE line in its body. The main function must call the function moose so that the function moose (in the program below) causes the printed output from the main program to be 99. There may not be any calculation at all in the main function. No given statements may be modified. No additional statements may be added. There may be no printed output from moose, and 1ine c may not involve any printing. You may write only the three lines: a) complete the function header, b) give a single statement in the function body, c) a statement in the main function to invoke (call) the function moose. (The letterings are indicated as comments) #include void moose int main (void) int tiny: int abalone, tiny_abalone; abalone = 11; tiny = 22; tiny-abalone = 66; printf( "%d " tiny-abalone); ,

Explanation / Answer

#include <stdio.h>

void moose(int buffalo, int name, int other) // Three parameters buffalo, name and other
{
int total=buffalo+name+other; // Adding all the three parameters
}


int main(void)
{
int tiny;
int abalone, tiny_abalone;
abalone=11;
tiny=22;
tiny_abalone=66;
moose(abalone,tiny,tiny_abalone); // Calling the moose function with three arguments
printf("%d ", tiny_abalone);
}

output:

66