Help with the C Tutorial on functions.
Hi all, I'm currently going through the tutorial on c and I am confused by the following code:
Code:
#include <stdio.h>
int mult ( int x, int y );
int main()
{
int x;
int y;
printf( "Please input two numbers to be multiplied: " );
scanf( "%d", &x );
scanf( "%d", &y );
printf( "The product of your two numbers is %d\n", mult( x, y ) );
getchar();
}
int mult (int x, int y)
{
return x * y;
}
Is there any need for:
Code:
int mult (int x, int y)
Surely,
does the same?
For both the prototype and the definition...
Thanks for any help!