1) Write a function that accepts three numbers as parameters and returns their s
ID: 3728594 • Letter: 1
Question
1) Write a function that accepts three numbers as parameters and returns their sum. Don't use any other functions for this. 2) Write a function that accepts two numbers as parameters and returns the difference of the first number minus the second. No other functions allowed. 3) Write a function that accepts two numbers as parameters and returns the integer quotient of the first divided by the second. floor function allowed. 4) Write a function that accepts two numbers as parameters and returns the integer remainder of the first divided by the second. floor function allowed. 5) Write a function that accepts a String as a parameter and outputs it to the screen. fprintf function allowed.Explanation / Answer
int sum(int x, int y, int z) {
return (x+y+z);
}
int difference(int x, int y) {
return (x-y);
}
int quoitent(int x, int y) {
return floor(x/y);
}
int remainder(int x, int y) {
return floor(x%y);
}
void print(char str[]) {
fprintf(stdout, "%s",str);
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.