Hi Mikrom,
Your help appreciated please.
I keep getting a TYPE MISMATCH Error on Line 14 ( Line No 240)
Can you help please.
100 REM 6N +- 1 Test V15.3
110 DIM P1 AS LONG
115 DIM P2 AS LONG
120 DIM N1 AS LONG
125 DIM N2 AS LONG
130 INPUT “Number “; N
140 IF N <= 0 THEN GOTO 999
150 N1 = N
160 N2 = N
200 P1 = (6 * N1) -1
210 FOR N1 = 2 TO SQR(P1)
220 IF P1 MOD N1 = 0 THEN PRINT USING “################”; P1; "is Composite": GOTO 300
230 NEXT N1
240 PRINT USING “################”; P1; " is Prime"
300 P2 = (6 * N2) +1
310 FOR N2 = 2 TO SQR(P2)
320 IF P2 MOD N2 = 0 THEN PRINT USING “################”; P2; "is Composite": GOTO 130
330 NEXT N2
340 PRINT USING “################”; P2; " is Prime"
350 GOTO 130
999 END
Pervez
Your help appreciated please.
I keep getting a TYPE MISMATCH Error on Line 14 ( Line No 240)
Can you help please.
100 REM 6N +- 1 Test V15.3
110 DIM P1 AS LONG
115 DIM P2 AS LONG
120 DIM N1 AS LONG
125 DIM N2 AS LONG
130 INPUT “Number “; N
140 IF N <= 0 THEN GOTO 999
150 N1 = N
160 N2 = N
200 P1 = (6 * N1) -1
210 FOR N1 = 2 TO SQR(P1)
220 IF P1 MOD N1 = 0 THEN PRINT USING “################”; P1; "is Composite": GOTO 300
230 NEXT N1
240 PRINT USING “################”; P1; " is Prime"
300 P2 = (6 * N2) +1
310 FOR N2 = 2 TO SQR(P2)
320 IF P2 MOD N2 = 0 THEN PRINT USING “################”; P2; "is Composite": GOTO 130
330 NEXT N2
340 PRINT USING “################”; P2; " is Prime"
350 GOTO 130
999 END
Pervez