Thursday 30 January 2014

Count the digit

Design Form :-
1. Select one command button on form.

Now double click on command button then type that code :-

Private Sub Command1_Click()

Dim n As Integer, a As Integer, k As Integer

n =inputbox("enter the number");

while(n>0)
a=n mod 10
k=k+1
n=int(n/10)
wend
print k

No comments:

Post a Comment