answersLogoWhite

0


Best Answer

Cls

input "enter the no. You want to check", a

if a <=0 then print "only natural nos allowed"

if a <=0 end

let m = a - 1

for i = m to 2 step -1

if a mod i = 0 then print "not prime"

if a mod i = 0 then end

next i

print "prime"

end

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you check a prime number in qbasic?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Is the number 1663561 a prime number?

No, it is not. You can check on prime-numbers.org


Is 4343 a prime number?

No its not a prime number Check out related links


How do you check if a number is a prime or not?

A prime number can only be divided by itself and 1


Write a java programme to check whether the number is twin prime or not?

Find a prime number, add 2 to the number. Check if the new number is prime. IE : 3 is prime. 3+2 =5. 5 is prime. (3,5) are twin primes.


What is the largest prime number you have to check to decide if 221 is prime?

13


What is the largest prime number to check for prime numbers under 100?

the largest prime number under 100 is 97


How do you check if a large number is prime or a composite number?

You divide the number by 2. If the number is able to divide WITHOUT a remainder, then it is a prime number. If you divide a number by 1, you will get the same number. That is not a prime number.


A number that is not prime?

A prime number is any number that only has one and itself as factors. Threfore, any number taht has more than two factors is not prime. Check the the factors of a number to tell if it is prime or not.


Not a prime number?

A prime number is any number that only has one and itself as factors. Threfore, any number taht has more than two factors is not prime. Check the the factors of a number to tell if it is prime or not.


Which of these numbers is not a prime number?

A prime number is any number that only has one and itself as factors. Therefore, any number that has more than two factors is not prime. Check the the factors of a number to tell if it is prime or not.


What numbers is not a prime number?

A prime number is any number that only has one and itself as factors. Therefore, any number that has more than two factors is not prime. Check the the factors of a number to tell if it is prime or not.


How can you tell whether za number is prime?

A number is prime if it only has two distinct factors.