Advertisement
Agus_Darmawan

cek_kolestrol

Sep 30th, 2019
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main() {
  4.  
  5.     int HDL, LDL, triglyserida;
  6.     float total, rasio;
  7.  
  8.     printf("HDL: "); scanf("%i", &HDL);
  9.     printf("LDL: "); scanf("%i", &LDL);
  10.     printf("Triglyserida: "); scanf("%i", &triglyserida);
  11.  
  12.     total = (float)LDL + (float)HDL + ((float)triglyserida / 5);
  13.     printf("Total: %.0f\n",total);
  14.  
  15.     rasio = total / (float)HDL;
  16.     printf("Rasio total / HDL: %f\n",rasio);
  17.  
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement