#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
void hitungsuhu();
void hitungsuhureamur();
void hitungsuhufahrenheit();
void main()
{
int pilih;
menu :
puts("/---------------------------------------------------------/");
puts("/- Temperature Program version 1 -/");
puts("/- By : Eko Budianto -/");
puts("/- vintage_series@yahoo.com -/");
puts("/- Student of Informatic Engineering -/");
puts("/- Universitas Pembangunan Nasional 'Veteran' Yogyakarta -/");
puts("/- Indonesia -/");
puts("/---------------------------------------------------------/");
pilihan :
puts("\n\n/---------------------/");
puts("/- Input : -/");
puts("/- 1. Celcius -/");
puts("/- 2. Reamur -/");
puts("/- 3. Fahrenheit -/");
puts("/- 4. About Me -/");
puts("/- 5. Exit -/");
puts("/---------------------/");
printf("Option :");
scanf("%d", &pilih);
switch(pilih)
{
case 1 : {
hitungsuhu();
goto pilihan;
break;
}
case 2 : {
hitungsuhureamur();
goto pilihan;
break;
}
case 3 : {
hitungsuhufahrenheit();
goto pilihan;
break;
}
case 4 : {
puts("\n/------------------------------/");
puts("/- This program was made by : -/");
puts("/- Eko Budianto -/");
puts("/- vintage_series@yahoo.com -/");
puts("/------------------------------/");
goto pilihan;
break;
}
case 5 : {
exit(0);
break;
}
}
goto menu;
}
void hitungsuhu()
{
float c;
float r;
float f;
printf("\n\nPlease Input Temperature (Celcius) :");
scanf("%f", &c);
r=0.8*c;
f=(1.8*c)+32;
printf("\n%5.2f Celcius = %5.2f Reamur", c, r);
printf("\n%5.2f Celcius = %5.2f Fahrenheit", c, f);
}
void hitungsuhureamur()
{
float c;
float r;
float f;
printf("\n\nPlease Input Temperature (Reamur) :");
scanf("%f", &r);
c=(5*r)/4;
f=((9*r)/4)+32;
printf("\n%5.2f Reamur = %5.2f Celcius", r, c);
printf("\n%5.2f Reamur = %5.2f Fahrenheit", r, f);
}
void hitungsuhufahrenheit()
{
float c;
float r;
float f;
printf("\n\nPlease Input Temperature (fahrenheit) :");
scanf("%f", &f);
c=(5*(f-32))/9;
r=4*(f-32)/9;
printf("\n%5.2f Fahrenheit = %5.2f Celcius", f, c);
printf("\n%5.2f Fahrenheit = %5.2f Reamur", f, r);
}