Walk Lightly on this PLANET and yet leave such a FOOTPRINT that cannot be erased for thousands of Years..!!!
Visit Codstech for Cyber Security related Posts !

Visitors

Showing posts with label VB-For-Next. Show all posts
Showing posts with label VB-For-Next. Show all posts

Wednesday, August 10, 2011

VB-97 : Print Multiplication Table

Print a multiplication table for a given number.



(A)Program Design : 




(B) Property(Controls Used) :
  • One Label with Caption Enter a number to print Multiplication Table
  • One TextBox with Name-Text1 and Text Property is Blank
  • One Command Button with Name-Command1 and Caption -Print

C) Attaching Code to the Object :

Private Sub Command1_Click()
Dim counter, n, p As Integer
n = Val(Text1.Text)
For counter = 1 To 10
p = n * counter
Print n; " x "; counter; " = "; p
Next counter
End Sub




(D) Output :


Such a simple program and the Powerful Output..Right..?

(E) Errors :


If found any errors while running your VB program, or want to put your comment about any  program , please click Comment section , to post.


      • ====================================================================
        Back to Home   &  VB
    ===========================================================

    Friday, May 27, 2011

    VB-9 : Print name 10 times(For-Next Loop)


    Refer Print "Hello" 10 times(Do-While) also.

    We need 2 command buttons.
    The output will print names of first 10 students in the array batch on the click event(For-NextLoop)

    A)   Property :
    Command button : NAME- Command1 , CAPTION- Click
    Command button : NAME- Command2 , CAPTION- Exit




    B)   Attaching Code to the Object :
    Private Sub Command2_Click()
    End
    End Sub

    Private Sub Form_Click()
    Dim i As Integer
    For i = 0 To 9
    Print Batch(i)
    Next i
    End Sub




    =========================================================================
    (Check the output)


    Back to Home   &  VB