Advertisement
Mashudi

Konversi-Suhu(header stdio.h)

Oct 3rd, 2014
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.05 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     int c,f,r;
  6.         printf("==============================\n");
  7.         printf("====Aplikasi Konversi Suhu====\n");
  8.         printf("==============================\n");
  9.         printf("==============================\n");
  10.         printf("Konversi Celcius ke Fahrenheit\n");
  11.         printf("==============================\n");
  12.         printf("Masukkan Suhu dalam Celcius : ");
  13.         scanf("%d",&c);
  14.         printf("==============================\n");
  15.         //Menghitung Celcius ke Fahrenheit, 9/5 telah di proses sehingga menjadi 1.8
  16.         f = c * 1.8 + 32;
  17.         //Menghitung Celcius ke Reamur, 4/5 telah di proses sehingga menjadi 0.8
  18.         r = c * 0.8;
  19.         printf("Hasil Konversi Celcius ke Fahrenheit = %d \n",f);
  20.         printf("==============================\n");
  21.         printf("Konversi Celcius ke Reamur\n");
  22.         printf("==============================\n");
  23.         printf("Hasil Konversi Celcius ke Reamur = %d \n",r);
  24.         printf("==============================\n");
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement