[ Console ] Source Code Program Konversi Suhu C#

[ Console ] Source Code Program Konversi Suhu C# | IDCsharp.com
[ Console ] Source Code Program Konversi Suhu C# | IDCsharp.com

Program Konversi Suhu merupakan program yang dapat mengkonversi suhu dari :

  • Celcius ke Fahrenheit
  • Celcius ke Reamur
  • Celcius ke Kelvin

Program Konversi Suhu ini dibuat menggunakan algoritma bahasa pemrograman C#.

Cara kerja program Konversi Suhu ini adalah, Mula-mula user diperintah untuk angka suhu dari Celcius, Setelah Angka di inputkan, maka selanjutnya program akan menampilkan hasilnya.

Ingin tahu bagaimana Kode Programnya ?

 

Source Code :

using System;
					
public class Program
{
	public static void Main()
	{
		double celcius, fahrenheit, reamur, kelvin; // Deklarasi Variable
		
		
		
		Console.WriteLine(" =========================================");
		Console.WriteLine(" |	Konversi Suhu : Celcius to");
		Console.WriteLine(" |	Fahreheit | Kelvin | Reamur");
		Console.WriteLine(" =========================================");
		
		Console.Write(" Masukkan suhu dalam celcius = "); //User Input
		celcius = Convert.ToDouble(Console.ReadLine());
		
		fahrenheit = (celcius*1.8) + 32; // Deklarasi Rumus
		reamur  =  celcius * 0.8;
		kelvin = celcius + 273.15;
		Console.WriteLine("\n");
		
		//Output Hasil
		Console.WriteLine(" ========================================");
		Console.WriteLine(" |	Hasil Konversi Suhu");
		Console.WriteLine(" ========================================");
		Console.WriteLine(" | FAHRENHEIT  =  "+fahrenheit);
		Console.WriteLine(" | REAMUR      =  "+reamur);
		Console.WriteLine(" | KELVIN      =  "+kelvin);
		Console.WriteLine(" ========================================");
		
		Console.WriteLine("\n");
		
		Console.WriteLine(" ========================================");
		Console.WriteLine(" |	Learn More @ idcsharp.com");
		Console.WriteLine(" ========================================");

 
    }
}


.Net Fiddle

You may also like...