Program to know it is Prime Number or Not in QBASIC
CLS
Fcount = 0
PRINT "Enter a number which you want to verify it is prime or not"
INPUT "Enter a number"; n
FOR i = 1 TO n
IF (n MOD i = 0) THEN Fcount = Fcount + 1
NEXT i
IF Fcount = 2 THEN
PRINT " It is a Prime Number";
ELSE
PRINT "It is not a Prime Number"
END IF
0 Comments
Thank You ! For your love