error:statement missing;in function prodct 如何改正

来源:百度知道 编辑:UC知道 时间:2024/06/15 22:14:21
# include "stdio.h"
main()
{intx,y,p;
scanf("%d,%d,&x,&y");
p=prodct(x,y);
printf("The product is %d",p);
int prodct(int a,int b)
{int c;
c=a*b;
return c;
}

# include "stdio.h"
int prodct(int a,int b); //前置声明,或者将函数直接提到前面来。
main()
{intx,y,p;
scanf("%d,%d,&x,&y");
p=prodct(x,y);
printf("The product is %d",p);
} // main函数没有以}结束。
int prodct(int a,int b)
{int c;
c=a*b;
return c;
}