Advertisement
spasnikolov131

Untitled

May 23rd, 2021
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Multiply_by_2
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. double num = 0;
  10. while (true)
  11. {
  12. if (num < 0)
  13. {
  14. Console.WriteLine("Negative number!");
  15. break;
  16. }
  17. else
  18. {
  19. num = double.Parse(Console.ReadLine());
  20. double result = num * 2;
  21. Console.WriteLine($"Result: {result:f2}");
  22. }
  23. }
  24. }
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement