answersLogoWhite

0

Program for printing prime numbers in vb?

Updated: 8/17/2019
User Avatar

Wiki User

12y ago

Best Answer

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

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Program for printing prime numbers in vb?
Write your answer...
Submit
Still have questions?
magnify glass
imp
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.


VB program to convert meter to centimeter?

w


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