09-17-2010, 01:04 PM
(This post was last modified: 09-17-2010, 01:05 PM by SaranKumarV.)
Hi,
Could some one please tell me how to count occurence of 3digit between 3 and 3333.
I tried with the following code I am getting the numbers which contain 3 in the number but problem comes when there is number like (3000) which prints 4 times since length of the number (3000) is 4.
Could some one please tell me how to count occurence of 3digit between 3 and 3333.
I tried with the following code I am getting the numbers which contain 3 in the number but problem comes when there is number like (3000) which prints 4 times since length of the number (3000) is 4.
Code:
For i=3 to 3333
temp=i
While temp>0
d=instr(temp,3)
If (d <> 0) Then
c = c+1
print(i)
End If
temp = temp/10
temp = Fix(temp)
Wend
Next
Print(c)