Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class MultiplicationSign
- {
- static void Main ()
- {
- Console.Write("Please, enter the First real number, A = ");
- string numberStr = Console.ReadLine();
- decimal numA = decimal.Parse(numberStr);
- Console.Write("Enter the Second real number, B = ");
- numberStr = Console.ReadLine();
- decimal numB = decimal.Parse(numberStr);
- Console.Write("Enter the Third real number, C = ");
- numberStr = Console.ReadLine();
- decimal numC = decimal.Parse(numberStr);
- char signNum;
- if (numA != 0 && numB != 0 && numC != 0)
- {
- if ((numA > 0 && numB > 0 && numC > 0) || (numA > 0 && numB < 0 && numC < 0)
- || (numA < 0 && numB > 0 && numC < 0) || (numA < 0 && numB < 0 && numC > 0))
- {
- signNum = '+';
- }
- else
- {
- signNum = '-';
- }
- }
- else
- {
- signNum = '0';
- }
- Console.WriteLine("The Sign of Multiplication of these 3 numbers is: SIGN = {0} !",
- signNum);
- Console.ReadLine();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement