Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace MultiplyBy2
- {
- class MultiplyBy2
- {
- static void Main(string[] args)
- {
- double num = 0;
- while (true)
- {
- num = double.Parse(Console.ReadLine());
- if (num >= 0)
- {
- double result = num * 2;
- Console.WriteLine($"Result: {result:f2}");
- }
- else if (num < 0)
- {
- Console.WriteLine("Negative number!");
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement