Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class ShowSignOfProduct
- {
- static void Main()
- {
- int countPositive = 1;
- int[] array = new int[3];
- for (int i = 0; i < array.Length; i++)
- {
- Console.WriteLine("Enter element:");
- array[i] = int.Parse(Console.ReadLine());
- if (array[i] > 0)
- {
- countPositive = countPositive + 1;
- }
- }
- if (countPositive % 2 == 0)
- {
- Console.WriteLine("The product of number is positive \"+\"");
- }
- else
- {
- Console.WriteLine("The product of number is negative \"-\"");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement