Create a two-variable addition calculator cal_sum(a, b) that returns the sum of the two variables.
时间: 2023-03-31 22:00:58 浏览: 71
好的,我可以回答这个问题。以下是代码:
```c
#include <stdio.h>
int cal_sum(int a, int b) {
return a + b;
}
int main() {
int a = 5, b = 7;
int sum = cal_sum(a, b);
printf("The sum of %d and %d is %d\n", a, b, sum);
return ;
}
```
输出结果为:The sum of 5 and 7 is 12。
阅读全文