Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main (void)
- {
- char name[20];
- float m, h, bmi;
- printf ("Write name: ");
- scanf ("%s", &name);
- printf("Enter weight and height:\t");
- scanf("%f %f", &m, &h);
- printf("%f %f", m, h);
- bmi=m/(h*h);
- printf("\n\nHello %s! \n\nYour BMI is: %5.2f\n", name, bmi);
- if (bmi<20) printf("\aYour weight is too small\n\n");
- else if (bmi<=25) printf("it's OK\n\n");
- else printf("\aYou have over\n\n");
- system ("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement