Here's a function calculating the division of two numbers. All variables and functions are declared as float. However, the code below does not compile and the error message shows that "%f expects argument of type double, but argument has type int" and "implicit declaration of function 'div'" and "conflicting types for 'div'".
#include <stdio.h>
#include <assert.h>
float div(float a, float b);
int main() {
float a = 5;
float b = 8;
printf("%f divided by %f is %f \n", a, b, div(a, b));
}
float div(float a, float b) {
assert(b != 0);
return a / b;
}