How to use Boolean variable in VB.NET

3 Answers

0 votes
Imports System
 
Public Module Program
    Public Sub Main(args() As string)
		Dim lang As String = "vb"
        Dim salary As Double = 9500
 
        Dim isVB As Boolean = (lang = "vb" And salary >= 8300)
 
        If isVB Then
            Console.WriteLine(True)
        Else
            Console.WriteLine(False)
        End If
     End Sub
End Module
 
 
 
' run:
' 
' True
'

 



answered Sep 22, 2018 by avibootz
edited May 4, 2024 by avibootz
0 votes
Imports System
 
Public Module Program
    Public Sub Main(args() As string)
		Dim lang As String = "vb"
        Dim salary As Double = 9000
 
        Dim isVB As Boolean = (lang = "vb" And salary >= 8300)
 
        Console.WriteLine(isVB)
     End Sub
End Module
 
 
 
' run:
' 
' True
'

 



answered Sep 22, 2018 by avibootz
edited May 4, 2024 by avibootz
0 votes
Imports System
 
Public Module Program
    Public Sub Main(args() As string)
    	Dim b As Boolean
  
        b = True
  
        If (b) Then
            Console.WriteLine("True")
        End If
  
        b = False
        If (b) Then
            Console.WriteLine("True")
        Else
            Console.WriteLine("False")
        End If
  
        If (Not b) Then
            Console.WriteLine("True")
        End If
    End Sub
End Module
 
 
 
' run:
' 
' True
' False
' True
'

 

 



answered May 4, 2024 by avibootz

Related questions

1 answer 162 views
1 answer 274 views
1 answer 189 views
2 answers 261 views
1 answer 199 views
1 answer 204 views
...