Advertisement
Asinka

ShowSignOfProduct

Nov 4th, 2012
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.68 KB | None | 0 0
  1. using System;
  2.  
  3.  
  4.  
  5. class ShowSignOfProduct
  6. {
  7.     static void Main()
  8.     {
  9.         int countPositive = 1;
  10.         int[] array = new int[3];
  11.         for (int i = 0; i < array.Length; i++)
  12.         {
  13.             Console.WriteLine("Enter element:");
  14.             array[i] = int.Parse(Console.ReadLine());
  15.             if (array[i] > 0)
  16.             {
  17.                 countPositive = countPositive + 1;
  18.             }
  19.         }
  20.         if (countPositive % 2 == 0)
  21.         {
  22.             Console.WriteLine("The product of number is positive \"+\"");
  23.         }
  24.         else
  25.         {
  26.             Console.WriteLine("The product of number is negative \"-\"");
  27.         }
  28.     }
  29.    
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement