Advertisement
gospod1978

Methods-Ex\More\Multiplication Sign

Oct 14th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.10 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Numerics;
  5.  
  6. namespace methods_exerci
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             int result = 0;
  13.  
  14.             Multiplication(result);
  15.         }
  16.  
  17.         static void Multiplication(int result)
  18.         {
  19.  
  20.             bool nula = false;
  21.             for (int i = 0; i < 3; i++)
  22.             {
  23.                 int number = int.Parse(Console.ReadLine());
  24.                 if (number == 0)
  25.                 {
  26.                     nula = true;
  27.                 }
  28.                 if (number < 0)
  29.                 {
  30.                     result++;
  31.                 }
  32.             }
  33.  
  34.             if (nula)
  35.             {
  36.                 Console.WriteLine("zero");
  37.             }
  38.             else
  39.             {
  40.  
  41.                 if (result % 2 == 0)
  42.                 {
  43.                     Console.WriteLine("positive");
  44.                 }
  45.                 else
  46.                 {
  47.                     Console.WriteLine("negative");
  48.                 }
  49.             }
  50.  
  51.         }
  52.     }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement