//user bisa mengulang program
//mencari berat badan
#include
#include
using namespace std;
int main(int argc, char *argv[])
{
double bb, tb, bmi;
char a= 'y';
while (a=='y')
{
cout<<"masukkan berat badan = ";
cin>>bb;
cout<<"masukkan tinggi badan = ";
cin>>tb;
bmi=bb/(tb*tb);
if (bmi>=30)
{
cout<<"obesitas"<
else
if (bmi>=25)
{
cout<<"gemuk"<
else
if (bmi>=19)
{
cout<<"ideal"<
else
{
cout<<"kurus"<
cout<<"mau mengulang program ini (y/t) = ";
cin>>a;
}
system("PAUSE");
return EXIT_SUCCESS;
}
0 komentar:
Posting Komentar