skipter icon

Exact Product of Real Numbers C#

skipter | PRO | 06/10/17 08:45:05 PM UTC | 0 ⭐ | 341 👁️ | Never ⏰ | []
C# |

600 B

|

None

|

0 👍

/

0 👎

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataBytes___Lab
{
    class Program
    {
        static void Main(string[] args)
        {
            int number = int.Parse(Console.ReadLine());
            decimal result = 1;
 
            for (int i = 1; i <= number; i++)
            {
                decimal currentNumber = decimal.Parse(Console.ReadLine());
                result *= currentNumber;                
            }
            Console.WriteLine(result);                       
         }
    }
}

Comments