LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

labview

hello, i'm doing a homework, can you help me?

i need   Develop a program in half-second intervals prime numbers from 1 to 100

 

someone can help me!!

please!

thanks!

0 Kudos
Message 1 of 8
(2,958 Views)

Please use a better subject. All posts here are about LabVIEW.

 

Please be specific about the sort of help you need. This is not a homework service but if you are stuck with something, people will assist you. You need to show the code that you have already written and explain your specific problem.

0 Kudos
Message 2 of 8
(2,953 Views)

If i am asking is because i dont understand that problem....really i´m just studying labview...sorry.-!

0 Kudos
Message 3 of 8
(2,945 Views)

You need to create a program that shows a new prime number every 500ms?

 

First I would say make a VI that can figure out if a number is prime.

 

Use a FOR loop with number of iterations set to 100.  The i is 0 based, so you will want to use the increment function to get the number to work with.  If the number is prime, display it and wait 500ms.  If the number is not prime, don't display or wait.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 8
(2,935 Views)

i'm doing whith 2n+1 and i'm doing whith a while. because i need numbers prime since 1 to 100...-!

 

 

Thanks!

0 Kudos
Message 5 of 8
(2,924 Views)

While many of the numbers your method will create will be prime numbers, many will not be prime, for example 15 occurs pretty early, but isn't a prime (it is made up of two primes 3 and 5), and you miss the first prime, 2.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



Message 6 of 8
(2,910 Views)

A for loop would probably be a better option than the while loop. You were given the basics of what you need to do in an earlier post. As mentioned, this forum is not here to do the work for you. You will learn far more doing it yourself. We will be happy to answer specific questions about issues you are encountering. You really do need to post what code you have done so far.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 7 of 8
(2,909 Views)

Are you looking for 100 prime numbers, or looking for the numbers between 1 and 100 that are prime?

 

Have you researched any algorithms or schemes to determine if a number is prime?

 

If you have a number, and go through every number less than that to determine if the number is divisible by that, you can throw the number out as non-prime has soon as you find a number divisible into it.  I think a function such as quotient/remainder would help you here.

0 Kudos
Message 8 of 8
(2,901 Views)