又出现随机数,这是为什么?
程序代码:
#include <stdio.h> //运行出来是随机数,谁能告诉我这是为什么? int main() { float op1,op2,sum,diff; void sum_diff(float op1,float op2,float*psum,float*pdiff); printf("input 2 figures:"); scanf("%d%d",&op1,&op2); sum_diff(op1,op2,&sum,&diff); printf("sum=%d\ndiff=%d\n",sum,diff); return 0; } void sum_diff(float op1,float op2,float*psum,float*pdiff) { *psum=op1+op2; *pdiff=op1-op2; }