fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4.  
  5. //Festlegen der Variablen
  6. float Gewicht;
  7. float Groesse;
  8. float BMI;
  9. //Eingabe
  10. scanf("%f", &Gewicht);
  11. scanf("%f", &Groesse);
  12. //Rechnung
  13. BMI = Gewicht/(Groesse*Groesse);
  14. printf("%f = %f / \(%f * %f\n)" , BMI, Gewicht, Groesse, Groesse); //Ausführung der Rechnung
  15. printf("Ihr BMI ist %f\n", BMI);
  16. // your code goes here
  17. return 0;
  18. }
Success #stdin #stdout 0s 2116KB
stdin
Standard input is empty
stdout
-nan = 0.000000 / (0.000000 * 0.000000
)Ihr BMI ist -nan