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
In QBasic, you can check if a number is prime by iterating through all numbers from 2 to the square root of the number and checking if the number is divisible by any of them. If the number is divisible by any number other than 1 and itself, it is not prime. You can implement this logic using a FOR loop and an IF statement in QBasic to determine if a given number is prime.
A prime number can only be divided by itself and 1
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.
13
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 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.
No, it is not. You can check on prime-numbers.org
No its not a prime number Check out related links
A prime number can only be divided by itself and 1
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.
13
the largest prime number under 100 is 97
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 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.
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.
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.
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.
A number is prime if it only has two distinct factors.