You call the function twice, that's what causes your problems. It's better not to combine the error and good return values, do something like this.
Code:
#include<stdio.h>
int calc(int a, int b);
int main ()
{
int first, second, answer;
printf("pick two numbers: \n");
scanf("%d %d", &first, &second);
if (calc(first, second, &answer))
return 1;
else
printf("the result is: %d", answer);
return 0;
}
int calc(int a, int b, int *c)
{
if (b == 0)
{
printf("you cannot divide with zero");
return 1;
}
*c = a/b;
return 0;
}