C语言实现两数相加函数示例
#include <stdio.h>
int add(int a, int b) {
return a + b;
}
int main() {
int num1, num2, sum;
printf("Enter two numbers: ");
scanf("%d%d", &num1, &num2);
sum = add(num1, num2);
printf("Sum of %d and %d is %d", num1, num2, sum);
return 0;
}
原文地址: https://www.cveoy.top/t/topic/odu1 著作权归作者所有。请勿转载和采集!