fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4.  
  5. int length, weight;
  6. float bmi;
  7.  
  8. printf("Enter weight and length: ");
  9.  
  10. scanf("%d %d", &weight, &length);
  11.  
  12. bmi = (float)weight / (length*length) * 10000.0f;
  13.  
  14. printf("BMI: %.2f", bmi);
  15.  
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0s 2252KB
stdin
64
170

stdout
Enter weight and length: BMI: 22.15