kirililchev3

Temperature conversion

May 31st, 2018
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.45 KB | None | 0 0
  1. using System;
  2.  
  3. namespace P05_Temperature_Conversion
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double farenheit = double.Parse(Console.ReadLine());
  10.             double celsius = FarenheitToCelsius(farenheit);
  11.             Console.WriteLine("{0:F2}",celsius);
  12.         }
  13.  
  14.         static double FarenheitToCelsius(double farenheit)
  15.         {
  16.             return (farenheit - 32) * 5 / 9;
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment