Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. static void DoMath(int startValue, int step, int rows)
  2. {
  3. float celsius = startValue;
  4. Console.WriteLine("Degrees Celsius Degrees Fahrenheit");
  5. for (int i = 0; i < rows; ++i)
  6. {
  7. Console.WriteLine("{0,-20:F2} {1:F2}", celsius, 9.0f / 5 * celsius + 32);
  8. celsius += step;
  9. }
  10. }
  11. // static void DoMath(int startValue, int step, int rows)
  12. // {
  13. // Console.WriteLine("Degrees Celsius Degrees Fahrenheit");
  14. // for (int celsius = startValue; celsius < rows*step+startValue; celsius+=step)
  15. // {
  16. // Console.WriteLine("{0,-20:F2} {1:F2}", celsius, 9.0f / 5 * celsius + 32);
  17. // }
  18. // }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement