VB.Net Program to Demonstrate the CLng() Function

You are currently viewing VB.Net Program to Demonstrate the CLng() Function

VB.Net program to demonstrate the CLng() function

'VB.Net program to demonstrate the CLng() function.

Module Module1

    Sub Main()
        Dim num As Long = 0

        Dim n1 As Single = 10.25
        Dim n2 As Integer = 12
        Dim n3 As Double = 25.35
        Dim n4 As String = "122"

        num = CLng(n1)
        Console.WriteLine("Long Integer Number: {0}", num)

        num = CLng(n2)
        Console.WriteLine("Long Integer Number: {0}", num)

        num = CLng(n3)
        Console.WriteLine("Long Integer Number: {0}", num)

        num = CLng(n4)
        Console.WriteLine("Long Integer Number: {0}", num)
    End Sub
    
End Module

Output

Long Integer Number: 10
Long Integer Number: 12
Long Integer Number: 25
Long Integer Number: 122
Press any key to continue . . .

Ranjith Kumar

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Reply