fork(6) download
  1. #include <stdio.h>
  2.  
  3. int main (void) {
  4. // Deklarationsteil
  5. float gewicht, groesse, bmi; // bmi: Body Mass Index
  6.  
  7. // Eingabe
  8. printf("\n\tBody Mass Index Rechner\n");
  9. printf("\nGeben Sie das Gewicht und die Groesse ein: ");
  10. scanf("%f %f",&gewicht, &groesse);
  11.  
  12. // Verarbeitung
  13. bmi = gewicht/( groesse*groesse );
  14.  
  15. // Ausgabe
  16. printf("\nDer Body Mass Index ist: %f \n", bmi);
  17. return 0;
  18. }
Success #stdin #stdout 0s 2164KB
stdin
65 1.7
stdout
	Body Mass Index Rechner

Geben Sie das Gewicht und die Groesse ein: 
Der Body Mass Index ist: 22.491348