Try this:
Code:
#include <stdio.h>
int div( int x, int y );
int mult(int x, int y);
int subt(int x, int y);
int add(int x, int y);
int main()
{
int num;
printf( "What would you like to do?\n" );
scanf( "%d", &num );
if ( num == 1)
{
int x;
int y;
printf( "Please enter two numbers that you would like to divide" );
scanf( "%d", &x );
scanf( "%d", &y );
printf( "The division of these two numbers is %d\n", div( x, y) );
getchar();
}
if ( num == 2)
{
int x;
int y;
printf( "Please enter two numbers that you would like to multiply" );
scanf( "%d", &x );
scanf( "%d", &y );
printf( "The product of these two numbers is %d\n", mult( x, y) );
getchar();
}
if ( num == 3 )
{
int x;
int y;
printf( "Please enter two numbers that you would like to add" );
scanf( "%d", &x );
scanf( "%d", &y );
printf( "The sum of these two numbers is %d\n", add( x, y) );
getchar();
}
if ( num == 4 )
{
int x;
int y;
printf( "Please enter two numbers that you would like to subtract" );
scanf( "%d", &x );
scanf( "%d", &y );
printf( "The difference of these two numbers is %d\n", subt( x, y) );
getchar();
}
return 0;
}
int div( int x, int y )
{
getchar();
return x / y;
}
int mult(int x, int y)
{
getchar();
return x * y;
}
int subt(int x, int y)
{
getchar();
return x - y;
}
int add(int x, int y)
{
getchar();
return x + y;
}
Always, declare all your functions without forgetting any function before the main function, and always define your functions outside the main function.
study the code to understand more
God Luck.