Answer to Question #256001 in C# for Umar farouk

Question #256001
Convert Celsius to Fahrenheit) Write a program that 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
1
Expert's answer
2021-10-24T13:53:02-0400
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();
        }
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS