国产gaysexchina男同gay,japanrcep老熟妇乱子伦视频,吃奶呻吟打开双腿做受动态图,成人色网站,国产av一区二区三区最新精品

VB.Net - If ... Then語句

2022-06-02 14:18 更新

它是控制語句的最簡單形式,經常用于決策和改變程序執(zhí)行的控制流程。 if-then語句的語法是:

If condition Then 
[Statement(s)]
End If

其中,condition是一個布爾或關系條件,Statement(s)是一個簡單或復合語句。 If-Then語句的示例是:

If (a <= 20) Then
   c= c+1
End If

如果條件的計算結果為true,那么If語句中的代碼塊將被執(zhí)行。 如果條件計算結果為假,則第一組代碼在If語句結束后(在結束If之后)將被執(zhí)行。

流程圖:



示例:

Module decisions
    Sub Main()
        'local variable definition 
        Dim a As Integer = 10

        ' check the boolean condition using if statement 
        If (a < 20) Then
            ' if condition is true then print the following 
            Console.WriteLine("a is less than 20")
        End If
        Console.WriteLine("value of a is : {0}", a)
        Console.ReadLine()
    End Sub
End Module
當上述代碼被編譯和執(zhí)行時,它產生以下結果:
a is less than 20
value of a is : 10
以上內容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號