Advertisement
VelizarAvramov

05. Temperature Conversion

Nov 17th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.48 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _05._Temperature_Conversion
  4. {
  5.     class TempConversation
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double fahrenheit = double.Parse(Console.ReadLine());
  10.  
  11.             double celsius = GetCelsius(fahrenheit);
  12.             Console.WriteLine($"{celsius:f2}");
  13.  
  14.         }
  15.  
  16.         static double GetCelsius(double fahrenheit)
  17.         {
  18.             double cels = (fahrenheit - 32) * 5 / 9;
  19.             return cels;
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement