vb Number Length

 


NUMBER LENGTH

VB CODE IS -



Private Sub cmdCalculate_Click()

    Dim n As Long

    n = Val(txtNum.Text)

    

    Select Case n

    Case 0 To 9

        lblResult.Caption = "Single digit number"

        

    Case 10 To 99

        lblResult.Caption = "two digit number"


    Case 100 To 999

        lblResult.Caption = "Three digit number"


    Case 1000 To 9999

         lblResult.Caption = "Four digit number"


    Case 10000 To 99999

        lblResult.Caption = "Five digit number"


    Case Else

        lblResult.Caption = "More than Five digit number"

    End Select


End Sub


Comments

Popular posts from this blog

Computer Mcq Part 1 (1-50)

Computer MCQ Part 4 (151-200)

Computer MCQ Part 3 (101-150)