answersLogoWhite

0

Option Explicit

Dim i,j,var,Flag,n

var=""

n=cint(InputBox("Enter nth Number to check Prime Numbers"))

i = 3

While i <= n

Flag = True

j = 2

While j <= i\2 And Flag

Flag = i Mod j > 0

j = j + 1

Wend

If Flag Then

var = var&" "&i

End If

i = i + 2

Wend

MsgBox("Prime numbers within n numbers "&n&"= : 1" & var)

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

How do you write Square program using vb?

write a vb program to find the magic square


Vb is extension of?

A Visual Basic program.


What is used in vb 6.0 for execution of programs?

I think events of objects are used to execute a program in VB.


How do you make a program for drivers license exam in VB?

To make a program for the drivers license exam in Vb on must find the proper software to download and install. this software can come from any verified site.


How do i run a mapbasic program from a vb6 program?

yes u can do it....running mapinfo file under VB 6


How do you program an antivirus?

Using the event paradigms of vB access the program codes of the antivirus by selecting i0steam as the main source........


How do you find the average of three numbers using vb script?

Add the numbers, then divide by three. I don't know vb script, but in most programming languages it would be something like this: result = (a + b + c) / 3


Can I legally distribute for no charge a Visual Basic program that I wrote or do I need some type of license?

You need to develop the VB program with a non student version of VB/VS. You can distribute the redistributable DLL's, but you can not distribute the debug versions. See your EULA.


How you find out bugs from vb 6 project?

If you run the program and it has an error/bug the line where the error originates will be marked by color yellow... it is where the program breaks or stop...


What is the extansion of VBNET?

If you save your VB.NET project, it will be a .vb file. You can also build your program, then it becomes an executable (.exe)


Can you make vb in vb?

Yes it is possible, most things are in VB


Code View Debug info use in vb 6?

The program should have a help area. search the helpe area for information about the debug information the program displays/