How to represent the Boolean "true" and "false" in VB.NET

1 Answer

0 votes
Imports System

' In VB.NET, Boolean values are represented using the built‑in keywords:
' True
' False

Module Program

    Sub Main()
        Dim flag As Boolean = True   
        Dim done As Boolean = False  

        ' Print Boolean values
        Console.WriteLine("flag = " & flag)
        Console.WriteLine("done = " & done)

        ' Using Boolean expressions
        Dim result As Boolean = (5 > 3)
        Console.WriteLine("5 > 3 evaluates to: " & result)

    End Sub

End Module

 
 
' run:
'
' flag = True
' done = False
' 5 > 3 evaluates to: True
'

 



answered 6 days ago by avibootz
edited 6 days ago by avibootz
...