1、#includevoid main()int a,b,sum;scanf(“%d,%d“,sum=a+b;printf(“%d+%d=%d“,a,b,sum);主函数接收和输出,被调函数求和 #includeint add(int a,int b);void main()int a,b,sum;scanf(“%d,%d“,sum=add(a,b);printf(“%d+%d=%d“,a,b,sum);int add(int a,int b)int sum;sum=a+b;return sum;主函数接收和求和,被调函数打印输出#include/调用函数声明void add(int a,int
2、b);/主函数void main() /接受两个整数int a,b;scanf(“%d,%d“,/求和/调用 add 函数add(a,b);void add(int a,int b)int sum;sum=a+b;/输出结果printf(“%d+%d=%d“,a,b,sum);主函数输出打印,被调函数接受和求和#includeint add();void main()int sum;sum=add();printf(“%d“,sum);int add()int a,b,sum;scanf(“%d,%d“,sum=a+b;return sum;主函数什么也不做,被调函数接收、求和、打印输出 #includevoid add();void main()add();void add()int a,b,sum;scanf(“%d,%d“,sum=a+b;printf(“%d“,sum);主函数接收,被调函数求和、打印输出#includevoid add(int sum);void main()int a,b,sum;scanf(“%d,%d“,sum=a+b;add(sum);void add(int sum)printf(“%d“,sum);