by Ankita Jain (1 Submission)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 3rd October 2005
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Accepts a number and checks if it is prime or not.
j=0
for i=1 to x
if x mod i =0 then
j=j+1
endif
next i
if j=2 then
print"Prime"
elseif j<>2 then
print"Composite"
elseif x=1 then
print "Neither Prime nor composite"
endif