c언어 질문!!소스 수정좀부탁드립니다 ㅠ 연산에러가뜹니다 ㅠ
콩순
질문 제목 :c언어 질문!!소스 수정좀부탁드립니다 ㅠ 연산에러가뜹니다 ㅠ 소스 가 에러가나서 수정좀 부탁드립니다.
소스 설명도 부탁드립니다.질문 내용 :
#include stdio.h
doublefour_math (int rule, double a, double b)
{
if(rule==1)
return a+b;
else if(rule==1)
return a-b;
else if(rule==1)
return a*b;
else if(rule==1)
return a/b;
else
printf(error!);
}
doublemax_math (double a,double b)
{
if(ab)
return a;
else if(ab)
return b;
else if(a==b)
return a;
else
printf(error!);
}
doublemin_math (double a,double b)
{
if(ab)
return b;
else if(ab)
return a;
else if(a==b)
return a;
else
printf(error!);
}
int main ()
{
int select_math;
double firstnum,secondnum;
printf(1.더하기 2.빼기 3.곱하기 4.나누기\n);
scanf(%d,&select_math);
printf(첫번째 수를 입력해주세요.\n);
scanf(%lf,&firstnum);
printf(두번째 수를 입력해주세요.\n);
scanf(%lf,&secondnum);
printf(두수의 연산결과 ::%lf\n, four_math(select_math,firstnum,secondnum));
printf(큰수::%lf\n 작은수::%lf\n, max_math(firstnum,secondnum), min_math(firstnum,secondnum));
return 0;
}