Files
Cpp-Cookbook/BMI/main.cpp

27 lines
601 B
C++

#include <iostream>
#include <windows.h>
#include <iomanip>
using namespace std;
float BMI(float a, float b) {
return a/(b*b);
}
int main() {
SetConsoleOutputCP(CP_UTF8);
cout << fixed << setprecision(2);
cout << "BMI-RECHNER" << endl;
cout << "-----------" << endl;
float Gewicht,Groesse;
cout << "bitte geben Sie die geforderten Daten an!" << endl;
cout << left << setw(20) << "Gewicht(in Kg):";
cin >> Gewicht;
cout << left << setw(22) << "Größe(in M):";
cin >> Groesse;
cout << endl << "BMI: \t\t\t" << BMI(Gewicht, Groesse);
return 0;
}