Program to multiply array of big integers in VB.net

Rajnilari2015
Posted by Rajnilari2015 under VB.NET category on | Points: 40 | Views : 133
Let's say we have an array of big integers like {234,213,666,879}. The objective is to find the multiplication of these numbers.Below program will do so

Imports System.Collections.Generic
Imports System.Linq

Namespace ConsoleApplication2
Class Program
Private Shared Sub Main(args As String())

Dim intCollection = New List(Of System.Numerics.BigInteger)() From { _
234, _
213, _
666, _
879 _
}
Dim product = intCollection.Aggregate(Function(a, b) a * b)
Console.WriteLine("Product is {0}", product)
Console.ReadKey()
End Sub
End Class
End Namespace


Result
---------
Product is 29178204588

Comments or Responses

Login to post response