Friday, June 29, 2012

PROGRAM BERAT BADAN IDEAL

PROGRAM BERATBADANIDEAL (BMI)

#include <stdio.h>
#include <conio.h>
void main()
{int BB,TB1;float TB2;float BBI,BMI;mulai:printf("\t# HITUNG BERAT BADAN IDEAL #\n");printf("\t# BODY MASS INDEX CALCULATION #\n\n");printf("BERAT BADAN(kg) =\n");scanf("%d",&BB);printf("TINGGI BADAN(cm)(ex:180) =\n");scanf("%d",&TB1);printf("TINGGI BADAN(m)(ex:1.80) =\n");scanf("%f",&TB2);printf("========================================\n");BMI=BB/(TB2*TB2);BBI=(TB1-100)*90/100;printf
("BERAT IDEAL ANDA = %f\n",BBI);
printf("BODY MASS INDEX ANDA = %f\n",BMI);if (BMI<18.5 && BMI>=0){printf("KETERANGAN = UNDER WEIGHT\n\n");}else if (BMI>=18.5 && BMI<25){printf("KETERANGAN = NORMAL\n\n");}else if (BMI>=25 && BMI<30){printf("KETERANGAN = OVER WEIGHT\n\n");}else if (BMI>=30){printf("KETERANGAN = OBESITAS\n\n");}else{printf("KETERANGAN = ERROR ON INPUT NUMBER\n\n");}printf("ULANGI PERHITUNGAN ?");getch();clrscr();goto mulai;}
http://htmlimg1.scribdassets.com/8uz6zdi0hse8ovo/images/1-66ffe69696.jpg

0 comments:

Post a Comment

KOMENTAR