Help with computer science question

Help with computer science question




Do a trace of the following function assuming it was called with input 3. (So the

computer came across an instruction that read mystery(3); ) This means make a table

for each of the variables: input, output and count, and write down all the values they

take. Look at the board for more instructions.



int mystery(int input){

int output = 1;

int count = 1;

while ( count < input){

count = count + 1;

output = output * count;

}

return output;

}





No Answers Posted Yet.