#include <stdio.h>


extern int add(int first,int second);

extern int sub(int first,int second);

extern int mul(int first,int second);

extern int div(int first,int second);


int main()

{

int first,second;

char op;

printf("please enter two numbers");

scanf("%d %d",&first,&second);

printf("please enter the operator");

scanf("%s",&op);

switch(op)

{


case'+':

printf("value=%d",add(first,second));

break;

case'-':

printf("value=%d",sub(first,second));

break;


case'*':

printf("value=%d",mul(first,second));

break;


case'/':

printf("value=%d",div(first,second));

break;


default:

printf("Error");

break;

}

return 0;

}


비주얼에선 돌아갓는데 우분투 터미널로 돌릴경우 


please enter two numbers

5

5

please enter the operator

+

value=5 라는결과가나옴;; 도저히 이해가안되여...


밑엔add.c 라는 파일소스( -,*,/ 모두같은방법으로햇음)


int add(int first,int second)

{

return first+second;

}