Notes
Notes - notes.io |
#include <stdio.h>
void konversi()
{
printf("--Memilih satuan skala yang ingin di konversi-- nn");
}
void celcius()
{
int pilih;
float bil, cel_romer, cel_kel, cel_fahrein, cel_newton, cel_delisle;
while(pilih!=6)
{
konversi();
printf("1. Romern2. Fahrenheitn3. Kelvinn4. Newtonn5. Delislen6. Kembali ke Awaln");
printf("Celcius Konversi ke : ");
scanf("%d", &pilih);
system("cls");
if (pilih == 1)
{
printf("Masukkan suhu awal anda: ");
scanf("%f", &bil);
cel_romer = (bil * 21/40) + 7.5;
printf("%.2f C = %.2f Ro ", bil, cel_romer);
}
if (pilih == 2)
{
printf("Masukkan suhu awal anda: ");
scanf("%f", &bil);
cel_fahrein = ((9 * bil) / 5) + 32;
printf("%.2f C = %.2f F ", bil, cel_fahrein);
}
if(pilih == 3)
{
printf("Masukkan suhu awal anda: ");
scanf("%f", &bil);
cel_kel = bil + 273;
printf("%.2f C = %.2f K ", bil, cel_kel);
}
if(pilih == 4)
{
printf("Masukkan suhu awal anda: ");
scanf("%f", &bil);
cel_newton = bil * 0,33;
printf("%.2f C = %.2f N", bil, cel_newton);
}
if(pilih == 5)
{
printf("Masukkan suhu awal anda: ");
scanf("%f", &bil);
cel_delisle = (100 - bil) * 1.5;
printf("%.2f C = %.2f De", bil, cel_delisle);
}
if (pilih == 6)
{
return 0;
}
system("PAUSE");
system("cls");
}
}
void romer()
{
int pilih;
float bil, romer_cel, romer_kel, romer_fahrein, romer_newton, romer_delisle;
while(pilih!=6)
{
konversi();
printf("1. Celciusn2. Fahrenheitn3. Kelvinn4. Newtonn5. Delislen6. Kembali ke Awaln");
printf("Romer Konversi ke : ");
scanf("%d", &pilih);
system("cls");
if (pilih == 1)
{
printf("Masukkan suhu awal anda: ");
scanf("%f", &bil);
romer_cel = (bil - 7.5) * 40/21;
printf("%.2f Ro = %.2f C ", bil, romer_cel);
}
if (pilih == 2)
{
printf("Masukkan suhu awal anda: ");
scanf("%f", &bil);
romer_fahrein = ((bil - 7.5) * 24/7) + 32;
printf("%.2f Ro = %.2f F ", bil, romer_fahrein);
}
if(pilih == 3)
{
printf("Masukkan suhu awal anda: ");
scanf("%f", &bil);
romer_kel = ((bil - 7.5) * 40/21) + 273.15;
printf("%.2f Ro = %.2f K ", bil, romer_kel);
}
if(pilih == 4)
{
printf("Masukkan suhu awal anda: ");
scanf("%f", &bil);
romer_newton = (bil - 7.5) * 22/35;
printf("%.2f Ro = %.2f N ", bil, romer_newton);
}
if(pilih == 5)
{
printf("Masukkan suhu awal anda: ");
scanf("%f", &bil);
romer_delisle = (60 - bil) * 20/7;
printf("%.2f Ro = %.2f De ", bil, romer_delisle);
}
if (pilih == 6)
{
return 0;
}
system("PAUSE");
system("cls");
}
}
void fahreinheit()
{
int pilih;
float bil, fahrein_cel, fahrein_kel, fahrein_romer, fahrein_newton, fahrein_delisle;
while(pilih!=6)
{
konversi();
printf("1. Celciusn2. Romern3. Kelvinn4. Newtonn5. Delislen6. Kembali ke Awaln");
printf("Fahreinheit Konversi ke : ");
scanf("%d", &pilih);
system("cls");
if (pilih == 1)
{
printf("Masukkan suhu awal anda: ");
scanf("%f", &bil);
fahrein_cel = (bil - 32) / 1.8;
printf("%.2f F = %.2f C ", bil, fahrein_cel);
}
if (pilih == 2)
{
printf("Masukkan suhu awal anda: ");
scanf("%f", &bil);
fahrein_romer = ((bil - 32) * 7/24) + 7.5;
printf("%.2f F = %.2f Ro ", bil, fahrein_romer);
}
if(pilih == 3)
{
printf("Masukkan suhu awal anda: ");
scanf("%f", &bil);
fahrein_kel = (bil + 459.67) / 1.8;
printf("%.2f F = %.2f K ", bil, fahrein_kel);
}
if (pilih == 4)
{
printf("Masukkan suhu awal anda: ");
scanf("%f", &bil);
fahrein_newton = (bil - 32) * 11/60;
printf("%.2f F = %.2f N ", bil, fahrein_newton);
}
if(pilih == 5)
{
printf("Masukkan suhu awal anda: ");
scanf("%f", &bil);
fahrein_delisle = (212 - bil) * 5/6;
printf("%.2f F = %.2f De ", bil, fahrein_delisle);
}
if (pilih == 6)
{
return 0;
}
system("PAUSE");
system("cls");
}
}
void kelvin()
{
int pilih;
float bil, kel_cel, kel_romer, kel_fahrein, kel_newton, kel_delisle;
while(pilih!=6)
{
konversi();
printf("1. Celciusn2. Romern3. Fahreinheitn4. Newtonn5. Delislen6. Kembali ke Awaln");
printf("Kelvin Konversi ke : ");
scanf("%d", &pilih);
system("cls");
if (pilih == 1)
{
printf("Masukkan suhu awal anda: ");
scanf("%f", &bil);
kel_cel = bil - 273;
printf("%.2f K = %.2f C ", bil, kel_cel);
}
if (pilih == 2)
{
printf("Masukkan suhu awal anda: ");
scanf("%f", &bil);
kel_romer = ((bil - 273.15) * 21/40) + 7.5;
printf("%.2f K = %.2f Ro ", bil, kel_romer);
}
if(pilih == 3)
{
printf("Masukkan suhu awal anda: ");
scanf("%f", &bil);
kel_fahrein = (bil * 1.8) - 459.67;
printf("%.2f K = %.2f F ", bil, kel_fahrein);
}
if (pilih == 4)
{
printf("Masukkan suhu awal anda: ");
scanf("%f", &bil);
kel_newton = (bil - 273.15) * 0.33;
printf("%.2f K = %.2f N ", bil, kel_newton);
}
if(pilih == 5)
{
printf("Masukkan suhu awal anda: ");
scanf("%f", &bil);
kel_delisle = (373.15 - bil) * 1.5;
printf("%.2f K = %.2f De ", bil, kel_delisle);
}
if (pilih == 6)
{
return 0;
}
system("PAUSE");
system("cls");
}
}
void newton()
{
int pilih;
float bil, newton_cel, newton_romer, newton_fahrein, newton_kel, newton_delisle;
while(pilih!=6)
{
konversi();
printf("1. Celciusn2. Romern3. Fahreinheitn4. Kelvinn5. Delislen6. Kembali ke Awaln");
printf("Newton Konversi ke : ");
scanf("%d", &pilih);
system("cls");
if (pilih == 1)
{
printf("Masukkan suhu awal anda: ");
scanf("%f", &bil);
newton_cel = bil * 100/33;
printf("%.2f N = %.2f C ", bil, newton_cel);
}
if (pilih == 2)
{
printf("Masukkan suhu awal anda: ");
scanf("%f", &bil);
newton_romer = (bil * 35/22) + 7.5;
printf("%.2f N = %.2f Ro ", bil, newton_romer);
}
if(pilih == 3)
{
printf("Masukkan suhu awal anda: ");
scanf("%f", &bil);
newton_fahrein = (bil * 60/11) + 32;
printf("%.2f N = %.2f F ", bil, newton_fahrein);
}
if (pilih == 4)
{
printf("Masukkan suhu awal anda: ");
scanf("%f", &bil);
newton_kel = (bil * 100/33) + 273.15;
printf("%.2f N = %.2f K ", bil, newton_kel);
}
if(pilih == 5)
{
printf("Masukkan suhu awal anda: ");
scanf("%f", &bil);
newton_delisle = (33 - bil) * 50/11;
printf("%.2f N = %.2f De ", bil, newton_delisle);
}
if (pilih == 6)
{
return 0;
}
system("PAUSE");
system("cls");
}
}
void delisle()
{
int pilih;
float bil, delisle_cel, delisle_romer, delisle_fahrein, delisle_kel, delisle_newton;
while(pilih!=6)
{
konversi();
printf("1. Celciusn2. Romern3. Fahreinheitn4. Kelvinn5. Newtonn6. Kembali ke Awaln");
printf("Delisle Konversi ke : ");
scanf("%d", &pilih);
system("cls");
if (pilih == 1)
{
printf("Masukkan suhu awal anda: ");
scanf("%f", &bil);
delisle_cel = 100 - (bil * 2/3);
printf("%.2f De = %.2f C ", bil, delisle_cel);
}
if (pilih == 2)
{
printf("Masukkan suhu awal anda: ");
scanf("%f", &bil);
delisle_romer = 60 - (bil * 0.35);
printf("%.2f De = %.2f Ro ", bil, delisle_romer);
}
if(pilih == 3)
{
printf("Masukkan suhu awal anda: ");
scanf("%f", &bil);
delisle_fahrein = 212 - (bil * 1.2);
printf("%.2f De = %.2f F ", bil, delisle_fahrein);
}
if (pilih == 4)
{
printf("Masukkan suhu awal anda: ");
scanf("%f", &bil);
delisle_kel = 373.15 - (bil * 2/3);
printf("%.2f De = %.2f K ", bil, delisle_kel);
}
if(pilih == 5)
{
printf("Masukkan suhu awal anda: ");
scanf("%f", &bil);
delisle_newton = 33 - (bil * 0.22);
printf("%.2f De = %.2f N ", bil, delisle_newton);
}
if (pilih == 6)
{
return 0;
}
system("PAUSE");
system("cls");
}
}
int main()
{
int menu;
while(menu!=7)
{
printf("--Pilihan Menu Konversi Suhu--nn");
printf("1. Celcius n" );
printf("2. Romer n");
printf("3. Fahrenheit n");
printf("4. Kelvin n");
printf("5. Newton n");
printf("6. Delisle n");
printf("7. Exit n");
printf("Anda memilih menu : ");
scanf("%d", &menu);
system("cls");
if (menu==1)
{
celcius();
}
if (menu==2)
{
romer();
}
if (menu==3)
{
fahreinheit();
}
if (menu==4)
{
kelvin();
}
if (menu==5)
{
newton();
}
if (menu==6)
{
delisle();
}
if (menu==7)
{
printf("See You nn");
}
else
{
system("cls");
}
}
system("PAUSE");
return 0;
}
|
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team