Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading;
- using System.Globalization;
- namespace _02.SignOfProduct
- {
- class SignOfProduct
- {
- static void Main()
- {
- System.Threading.Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
- Console.Write("Enter first number: ");
- double a = double.Parse(Console.ReadLine());
- Console.Write("Enter second number: ");
- double b = double.Parse(Console.ReadLine());
- Console.Write("Enter third number: ");
- double c = double.Parse(Console.ReadLine());
- int counter = 0;
- if (Math.Sign(a) == 1)
- {
- counter++;
- }
- if(Math.Sign(b) == 1)
- {
- counter++;
- }
- if (Math.Sign(c) == 1)
- {
- counter++;
- }
- if (counter % 2 == 0)
- {
- Console.WriteLine("Negative");
- }
- else
- {
- Console.WriteLine("Positive.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement