fork download
  1. #include<stdio.h>
  2. int main()
  3. {
  4. float num1,num2;
  5. printf("Enter 2 numbers:\n");
  6. scanf("%f %f",&num1,&num2);
  7. float add=num1+num2;
  8. float sub=fabs(num1-num2);
  9. float mul=num1*num2;
  10. float div=num1/num2;
  11. printf("addition : %.2f\n",add);
  12. printf("subtraction : %.2f\n",sub);
  13. printf("multiplication : %.2f\n",mul);
  14. printf("division : %.2f",div);
  15. }
  16.  
Success #stdin #stdout 0s 5280KB
stdin
Standard input is empty
stdout
Enter 2 numbers:
addition : -744571695654661666111488.00
subtraction : 744571695654661666111488.00
multiplication : -0.00
division : -inf