Advertisement
Guest User

MultiplicationSign

a guest
Mar 21st, 2014
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.68 KB | None | 0 0
  1. static void Main()
  2.         {
  3.             float a = float.Parse(Console.ReadLine());
  4.             float b = float.Parse(Console.ReadLine());
  5.             float c = float.Parse(Console.ReadLine());
  6.             char productSign = '-';
  7.  
  8.             if (a == 0 || b == 0 || c == 0)
  9.             {
  10.                 productSign = '0';
  11.             }
  12.             else
  13.             {
  14.                 if ((a > 0 && b > 0 && c > 0) || (a < 0 && b < 0 && c > 0) ||
  15.                     (a < 0 && b > 0 && c < 0) || (a > 0 && b < 0 && c < 0))
  16.                 {
  17.                     productSign = '+';
  18.                 }          
  19.             }
  20.             Console.WriteLine(productSign);
  21.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement