math.answers.com/math-and-arithmetic/Gw_basicCode_for_prime_numbers
Preview meta tags from the math.answers.com website.
Linked Hostnames
8- 34 links tomath.answers.com
- 18 links towww.answers.com
- 1 link totwitter.com
- 1 link towww.facebook.com
- 1 link towww.instagram.com
- 1 link towww.pinterest.com
- 1 link towww.tiktok.com
- 1 link towww.youtube.com
Thumbnail

Search Engine Appearance
Gw basicCode for prime numbers? - Answers
10 REM I believe this program will do what you want, but bear in mind that 20 REM I don't have GWBASIC and haven't used it in years, so I'm going by 30 REM memory and human error checking alone. There may be typos and 40 REM the like. This program finds up to MAXPRIMES prime numbers and 50 REM stores them in the array PRIME. It's then dumped out on the screen. 60 REM Enjoy! 70 REM 100 DEFINT A-Z 110 MAXPRIMES=1000:NUMPRIMES=2 120 DIM PRIME(1000) 130 PRIME(0) = 2:PRIME(1) = 3 140 CURRENTNUM = 5 150 WHILE(NUMPRIMES < MAXPRIMES) 160 TESTNUMBER = CURRENTNUM 170 GOSUB 1010 180 IF ISPRIME = 1THEN 190 PRIME(NUMPRIMES) = CURRENTNUM 200 NUMPRIMES = NUMPRIMES + 1 210 END IF 220 REM -- take advantage of the fact that all primes greater than 230 REM -- three are one away from a multiple of six 240 IF (CURRENTNUM + 1) MOD 6 = 0 THEN 250 CURRENTNUM = CURRENTNUM + 2 260 ELSE 270 CURRENTNUM = CURRENTNUM + 4 280 END IF 290 WEND 300 REM ============= 992 REM 1000 REM A Subroutine to see if the number TESTNUMBER is prime 1010 N = 0 1020 ISPRIME = 1 1030 WHILE ISPRIME = 1 AND N < NUMPRIMES AND PRIME(N) * PRIME(N) <= TESTNUMBER 1040 IF TESTNUMBER MOD PRIME(N) = 0 THEN ISPPRIME = 0 1050 N = N + 1 1060 WEND 1070 RETURN
Bing
Gw basicCode for prime numbers? - Answers
10 REM I believe this program will do what you want, but bear in mind that 20 REM I don't have GWBASIC and haven't used it in years, so I'm going by 30 REM memory and human error checking alone. There may be typos and 40 REM the like. This program finds up to MAXPRIMES prime numbers and 50 REM stores them in the array PRIME. It's then dumped out on the screen. 60 REM Enjoy! 70 REM 100 DEFINT A-Z 110 MAXPRIMES=1000:NUMPRIMES=2 120 DIM PRIME(1000) 130 PRIME(0) = 2:PRIME(1) = 3 140 CURRENTNUM = 5 150 WHILE(NUMPRIMES < MAXPRIMES) 160 TESTNUMBER = CURRENTNUM 170 GOSUB 1010 180 IF ISPRIME = 1THEN 190 PRIME(NUMPRIMES) = CURRENTNUM 200 NUMPRIMES = NUMPRIMES + 1 210 END IF 220 REM -- take advantage of the fact that all primes greater than 230 REM -- three are one away from a multiple of six 240 IF (CURRENTNUM + 1) MOD 6 = 0 THEN 250 CURRENTNUM = CURRENTNUM + 2 260 ELSE 270 CURRENTNUM = CURRENTNUM + 4 280 END IF 290 WEND 300 REM ============= 992 REM 1000 REM A Subroutine to see if the number TESTNUMBER is prime 1010 N = 0 1020 ISPRIME = 1 1030 WHILE ISPRIME = 1 AND N < NUMPRIMES AND PRIME(N) * PRIME(N) <= TESTNUMBER 1040 IF TESTNUMBER MOD PRIME(N) = 0 THEN ISPPRIME = 0 1050 N = N + 1 1060 WEND 1070 RETURN
DuckDuckGo
Gw basicCode for prime numbers? - Answers
10 REM I believe this program will do what you want, but bear in mind that 20 REM I don't have GWBASIC and haven't used it in years, so I'm going by 30 REM memory and human error checking alone. There may be typos and 40 REM the like. This program finds up to MAXPRIMES prime numbers and 50 REM stores them in the array PRIME. It's then dumped out on the screen. 60 REM Enjoy! 70 REM 100 DEFINT A-Z 110 MAXPRIMES=1000:NUMPRIMES=2 120 DIM PRIME(1000) 130 PRIME(0) = 2:PRIME(1) = 3 140 CURRENTNUM = 5 150 WHILE(NUMPRIMES < MAXPRIMES) 160 TESTNUMBER = CURRENTNUM 170 GOSUB 1010 180 IF ISPRIME = 1THEN 190 PRIME(NUMPRIMES) = CURRENTNUM 200 NUMPRIMES = NUMPRIMES + 1 210 END IF 220 REM -- take advantage of the fact that all primes greater than 230 REM -- three are one away from a multiple of six 240 IF (CURRENTNUM + 1) MOD 6 = 0 THEN 250 CURRENTNUM = CURRENTNUM + 2 260 ELSE 270 CURRENTNUM = CURRENTNUM + 4 280 END IF 290 WEND 300 REM ============= 992 REM 1000 REM A Subroutine to see if the number TESTNUMBER is prime 1010 N = 0 1020 ISPRIME = 1 1030 WHILE ISPRIME = 1 AND N < NUMPRIMES AND PRIME(N) * PRIME(N) <= TESTNUMBER 1040 IF TESTNUMBER MOD PRIME(N) = 0 THEN ISPPRIME = 0 1050 N = N + 1 1060 WEND 1070 RETURN
General Meta Tags
22- titleGw basicCode for prime numbers? - Answers
- charsetutf-8
- Content-Typetext/html; charset=utf-8
- viewportminimum-scale=1, initial-scale=1, width=device-width, shrink-to-fit=no
- X-UA-CompatibleIE=edge,chrome=1
Open Graph Meta Tags
7- og:imagehttps://st.answers.com/html_test_assets/Answers_Blue.jpeg
- og:image:width900
- og:image:height900
- og:site_nameAnswers
- og:description10 REM I believe this program will do what you want, but bear in mind that 20 REM I don't have GWBASIC and haven't used it in years, so I'm going by 30 REM memory and human error checking alone. There may be typos and 40 REM the like. This program finds up to MAXPRIMES prime numbers and 50 REM stores them in the array PRIME. It's then dumped out on the screen. 60 REM Enjoy! 70 REM 100 DEFINT A-Z 110 MAXPRIMES=1000:NUMPRIMES=2 120 DIM PRIME(1000) 130 PRIME(0) = 2:PRIME(1) = 3 140 CURRENTNUM = 5 150 WHILE(NUMPRIMES < MAXPRIMES) 160 TESTNUMBER = CURRENTNUM 170 GOSUB 1010 180 IF ISPRIME = 1THEN 190 PRIME(NUMPRIMES) = CURRENTNUM 200 NUMPRIMES = NUMPRIMES + 1 210 END IF 220 REM -- take advantage of the fact that all primes greater than 230 REM -- three are one away from a multiple of six 240 IF (CURRENTNUM + 1) MOD 6 = 0 THEN 250 CURRENTNUM = CURRENTNUM + 2 260 ELSE 270 CURRENTNUM = CURRENTNUM + 4 280 END IF 290 WEND 300 REM ============= 992 REM 1000 REM A Subroutine to see if the number TESTNUMBER is prime 1010 N = 0 1020 ISPRIME = 1 1030 WHILE ISPRIME = 1 AND N < NUMPRIMES AND PRIME(N) * PRIME(N) <= TESTNUMBER 1040 IF TESTNUMBER MOD PRIME(N) = 0 THEN ISPPRIME = 0 1050 N = N + 1 1060 WEND 1070 RETURN
Twitter Meta Tags
1- twitter:cardsummary_large_image
Link Tags
16- alternatehttps://www.answers.com/feed.rss
- apple-touch-icon/icons/180x180.png
- canonicalhttps://math.answers.com/math-and-arithmetic/Gw_basicCode_for_prime_numbers
- icon/favicon.svg
- icon/icons/16x16.png
Links
58- https://math.answers.com
- https://math.answers.com/math-and-arithmetic/Collapse_sinkholes_grow_over_minutes_or_hours
- https://math.answers.com/math-and-arithmetic/Gw_basicCode_for_prime_numbers
- https://math.answers.com/math-and-arithmetic/How_do_you_write_45.0008_in_word_form
- https://math.answers.com/math-and-arithmetic/How_many_hours_is_1290_in_minutes