Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. static void Main(string[] args)
  2. {
  3. double fahr = 100;
  4. int contador = 0;
  5. do
  6. {
  7. contador++;
  8. Console.WriteLine("{0} graus Fahrenheit equivale a {1} graus Celcius", fahr, Conversor(fahr).ToString("#.00"));
  9. fahr--;
  10.  
  11. if (contador == 10)
  12. {
  13. Console.WriteLine("\n");
  14. contador = 0;
  15. }
  16.  
  17. } while (fahr != -11);
  18. Console.ReadKey();
  19. }
  20.  
  21. /// <summary>
  22. ///
  23. /// </summary>
  24. /// <param name="f"></param>
  25. /// <returns></returns>
  26. public static double Conversor(double f)
  27. {
  28. double cel = 0;
  29. cel = 5.0 / 9.0 * (f - 32.0);
  30. return cel;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement