using System;
using System.Collections.Generic;
namespace App
{
class Program
{
static void Main(string[] args)
{
//reads a Celsius degree in a double value from the console,
//then converts it to Fahrenheit and displays the result.
//The formula for the conversion is as follows: fahrenheit = (9 / 5) * celsius + 32
Console.Write("Enter Celsius degree: ");
double celsius = double.Parse(Console.ReadLine());
double fahrenheit = (9.0 / 5.0) * celsius + 32.0;
Console.WriteLine("Fahrenheit: " + fahrenheit.ToString());
Console.ReadLine();
}
}
}
Comments
Leave a comment