VB.Net Program to Demonstrate the CSByte() Function

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

VB.Net program to demonstrate the CSByte() function

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

Module Module1

    Sub Main()
        Dim num As SByte = 0

        Dim n1 As Double = 10.25
        Dim n2 As Single = 12.25
        Dim n3 As Integer = 25
        Dim n4 As String = "122"


        num = CSByte(n1)
        Console.WriteLine("Signed Byte Number: {0}", num)

        num = CSByte(n2)
        Console.WriteLine("Signed Byte Number: {0}", num)

        num = CSByte(n3)
        Console.WriteLine("Signed Byte Number: {0}", num)

        num = CSByte(n4)
        Console.WriteLine("Signed Byte Number: {0}", num)
    End Sub
    
End Module

Output

Signed Byte Number: 10
Signed Byte Number: 12
Signed Byte Number: 25
Signed Byte 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