fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. float diff_abs(float *,float *);
  5.  
  6. int main() {
  7. float a,b;
  8. scanf("%f %f",&a,&b);
  9. printf("%.2f\n",diff_abs(&a,&b));
  10. printf("%.2f",diff_abs(&b,&a));
  11. return 0;
  12. }
  13.  
  14. float diff_abs(float *a,float *b){
  15. *a=a-b;
  16. return *a;
  17. }
Success #stdin #stdout 0s 9432KB
stdin
5
4
stdout
-1.00
1.00