you didn't say what your problem. try this to check whether given number is a Prime Number

Option Explicit
Public Function IsPrime(ByVal n As Long) As Boolean
Dim I As Long
IsPrime = False
If n <> 2 And (n And 1) = 0 Then Exit Function 'test if div 2
If n <> 3 And n Mod 3 = 0 Then Exit Function 'test if div 3
For I = 6 To Sqr(n) Step 6
If n Mod (I - 1) = 0 Then Exit Function
If n Mod (I + 1) = 0 Then Exit Function
Next I
IsPrime = True
End Function

thanks for your response dear but its showing compile error "invalid inside procedure"
sorry for incomplete description actually i need a program to print prime numbers from 1 to 100
i am working in vb6. and putting this coding in command button on click event, please check and reply.

actually i have made a program which is creating all of the non-prime numbers from 1 to 100 but i am unable to compare it... and generate prime numbers...

this is the program

Private Sub Command1_Click()
Dim o As Integer
Dim z As Integer
Dim y As Integer
Dim x As Integer
Dim W As Integer
Dim a(114) As Integer
o = 0
For z = 2 To 50
o = o + 1
a(o) = z * 2
Next z
For y = 2 To 33
o = o + 1
a(o) = y * 3
Next y
For x = 2 To 20
o = o + 1
a(o) = x * 5
Next x
For W = 2 To 14
o = o + 1
a(o) = W * 7
Next W
End Sub

When I execute this progammatically, I get a table with row heights much larger than when I do this manually.

Note : Sel is the Word.Selection object and the Clipboard contains an Excel Table.

public void AddClipboard()
{
Sel.PasteExcelTable(false,false, false);
var t = Sel.Tables[Sel.Tables.Count];
t.AutoFitBehavior(Word.WdAutoFitBehavior.wdAutoFitContent);
}

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...

Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...