problem returning variables
Code:
#include <stdio.h>
int get_employees(int);
main()
{
/*Variables*/
int employees;
get_employees(employees); /*call function*/
printf("%i", employees);
return 0;
}
int get_employees(int employees) /* the function*/
{
int x=0;
for (x = 1; x <=1; ++x)
{
printf("Please enter # of employees(1-10): ");
scanf("%i",&employees);
if (employees > 10)
{ printf ("Invalid Entry\n");
--x;
}
if (employees < 1)
{ printf ("Invalid Entry\n");
--x;
}
}
return employees;
}
Why does this print a random number instead of the one scanned in by the user???