|
@ -8,6 +8,23 @@ float calcBMI(float a, float b){ |
|
|
return 0; |
|
|
return 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const char* retResult(float points){ |
|
|
|
|
|
if(points < 16) |
|
|
|
|
|
return "Starkes Untergewicht"; |
|
|
|
|
|
else if(points < 18) |
|
|
|
|
|
return "Maessiges Untergewicht"; |
|
|
|
|
|
else if (points < 18.6) |
|
|
|
|
|
return "Leichtes Untergewicht"; |
|
|
|
|
|
else if (points < 25.1) |
|
|
|
|
|
return "Normalgewicht"; |
|
|
|
|
|
else if (points < 31) |
|
|
|
|
|
return "Leichtes Uebergewicht"; |
|
|
|
|
|
else if (points < 36) |
|
|
|
|
|
return "Mittleres Uebergewicht"; |
|
|
|
|
|
else |
|
|
|
|
|
return "Starkes Uebergewicht"; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
int main() |
|
|
int main() |
|
|
{ |
|
|
{ |
|
|
float var1 = 0; |
|
|
float var1 = 0; |
|
@ -22,20 +39,7 @@ int main() |
|
|
|
|
|
|
|
|
var3 = calcBMI(var1, var2); |
|
|
var3 = calcBMI(var1, var2); |
|
|
|
|
|
|
|
|
printf("\nIhr Body-Mass-Index liegt bei %.2f\n", var3); |
|
|
|
|
|
|
|
|
|
|
|
if(var3 < 16) |
|
|
|
|
|
printf("Starkes Untergewicht"); |
|
|
|
|
|
else if(var3 < 18) |
|
|
|
|
|
printf("Maessiges Untergewicht"); |
|
|
|
|
|
else if (var3 < 18.6) |
|
|
|
|
|
printf("Leichtes Untergewicht"); |
|
|
|
|
|
else if (var3 < 25.1) |
|
|
|
|
|
printf("Normalgewicht"); |
|
|
|
|
|
else if (var3 < 31) |
|
|
|
|
|
printf("Leichtes Uebergewicht"); |
|
|
|
|
|
else if (var3 < 36) |
|
|
|
|
|
printf("Mittleres Uebergewicht"); |
|
|
|
|
|
else |
|
|
|
|
|
printf("Starkes Uebergewicht"); |
|
|
|
|
|
|
|
|
printf("\nIhr Body-Mass-Index liegt bei %.2f - %s\n", var3, retResult(var3)); |
|
|
|
|
|
|
|
|
|
|
|
return 0; |
|
|
} |
|
|
} |