To use the function "mult" in main, you either have to have a prototype before main or the entire function definition before main. Otherwise, when the compiler gets to the point in main where you call your function (mult) it will complain that it's never heard of anything called "mult" before.
So, you can just put the whole function definition before main, or you can use a prototype, which tells the compiler that a function called "mult" exists, and will be defined later.
As for the compiler error, you declare mult to take two integers, but when you call it you provide none. You're also not returning anything from mult when, as it's defined, it should return an integer. Try changing mult to look like this:
void mult()
{
int x, y;
scanf("%d", &x);
scanf("%d", &y);
printf("The result is %d", x * y);
}
This declares the variables x and y inside of mult, rather than specifying them as values that have to be supplied when the function is called. Or you could do this:
#include
int mult (int x, int y);
int main()
{
printf("Hello\n");
int firstNumber, secondNumber, result;
scanf("%d", &firstNumber);
scanf("%d", &secondNumber);
resutl = mult(firstNumber, secondNumber);
printf("The result is %d", x * y);
}
int mult (int x, int y)
{
return x * y;
}