Module GCDRecFunc Sub Main() Dim m, n, g As Integer Console.Write("Enter 1st Number : ") m = CInt(Console.ReadLine()) Console.Write("Enter 2nd Number : ") n = CInt(Console.ReadLine()) g = gcd(m, n) Console.WriteLine("GCD = " + g.ToString()) Console.ReadLine() End Sub Function gcd(ByVal x As Integer, ByVal y As Integer) As Integer If x Mod y = 0 Then Return y Else Return gcd(y, x Mod y) End If End Function End Module
Visual Basic dot net VB.net programming microsoft .net framework object oriented language network enabled technology visual basic 2005 IDE integrated development environment console application microsoft cre common runtime environment
Find GCD using recursion
Subscribe to:
Post Comments (Atom)
It is really a great and useful piece of info. I’m glad that you shared this helpful info with us. Please keep us informed like this. Thank you for sharing.
ReplyDeleteDot Net Online Course
Visit us: Dot Net Online Training