Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.53 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main (void)
  5. {
  6.     char name[20];
  7.     float m, h, bmi;
  8.     printf ("Write name: ");
  9.     scanf ("%s", &name);
  10.     printf("Enter weight and height:\t");
  11.     scanf("%f %f", &m, &h);
  12.     printf("%f %f", m, h);
  13.     bmi=m/(h*h);
  14.     printf("\n\nHello %s! \n\nYour BMI is: %5.2f\n", name, bmi);
  15.     if (bmi<20) printf("\aYour weight is too small\n\n");
  16.        else if (bmi<=25) printf("it's OK\n\n");
  17.                else printf("\aYou have over\n\n");
  18. system ("PAUSE");
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement