题目内容
阅读以下程序,按要求在空白处填写适当的表达式或语句,使程序完整并符合题目要求。计算输入的两个数的和与差:定义函数sum_diff(float op1, float op2, float *psum, float *pdiff),其中 op1 和 op2 是输入的两个数,*psum 和*pdiff 是计算得出的和与差。#include void sum_diff(float op1, float op2, float *psum, float *pdiff);int main (void){float op1, op2, sum, diff;void sum_diff(float op1, float op2, float *psum, float *pdiff);printf(“input op1 and op2: “);scanf(“%f%f”, &op1, &op2);________;printf(“%f+%f=%f; %f-%f=%f \n”,op1,op2,sum,op1,op2,diff);return 0;}void sum_diff(float op1, float op2, float *psum, float *pdiff){________ = op1 + op2;________= op1 – op2;}
查看答案
搜索结果不匹配?点我反馈
更多问题