Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // integer numbers { without operator star )
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _3.integer_numbers___without_operator_star__
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.Write("num1 = ");
- int num1 = Int32.Parse (Console.ReadLine());
- Console.Write("num2 = ");
- int num2 = Int32.Parse(Console.ReadLine());
- Console.Write("num3 = ");
- int num3 = Int32.Parse(Console.ReadLine());
- int negatives = 0;
- if (num1 < 0) negatives++;
- if (num2 < 0) negatives++;
- if (num3 < 0) negatives++;
- if (negatives % 2 == 0)
- Console.WriteLine("The product is a positive number");
- else
- Console.WriteLine("The product is a negative number");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment