Guest User

Untitled

a guest
Feb 21st, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace Farenheit_Celsius
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. float farenheit = 0;
  13. float celsius = 0;
  14. Console.Write("Skriv in temperaturen i Farenheit: ");
  15. try
  16. {
  17. farenheit = float.Parse(Console.ReadLine());
  18. celsius = (farenheit - 32) * 5 / 9;
  19. Console.WriteLine("Temperaturen {0}°F blir {1:F1}°C", farenheit, celsius);
  20. }
  21. catch
  22. {
  23. Console.WriteLine("Du har inte skrivit in ett tal i korrekt form!");
  24. }
  25.  
  26. Console.ReadKey();
  27. }
  28. }
  29. }
Add Comment
Please, Sign In to add comment