1: #include
2: int main( )
3:{
4: int product(int x,int y); //调用函数product(x,y);
5: int val1,val2,val3; //定义三个变量.
6: printf(”Enter a number between 1 and 100:”); //输入1到100之间的一个数.
7: scanf(“%d”, &val1); //输入1到100之间的一个数.
8: printf(”Enter another number between 1 and 100:”);
9: scanf(“%d”, &val2); //输入1到100之间的另一个数.
10: val3 = product(val1,val2); //求两个数的乘积.
11: printf("%d time %d=%dn", val1,val2,val3); //输出乘积
12: return 0;
13:}
14:int product(int x,int y)
15:{
16: return(x*y); //函数体.返回x,y的乘积.
17:}