1. TO INPUT 'N' DIFFERENT NUMBERS AND DISPLAY ONLY PRIME NUMBERS.
START
STEP 1: DECLARE THE VARIABLES K, J , C ,N AND NUM AS INTEGER
STEP 2: J=1 , C=0 , NUM=0 , N=0 , K=1
STEP 3: INPUT " HOW MANY NUMBERS:" ; N
STEP 4: INPUT "ENTER THE NUMBER" ; NUM
STEP 5 : IF NUM % J =0 THEN C=C+1
STEP 6 : INCREMENT THE VALUE OF J BY 1
STEP 7: IF J<=NUM THEN GOTO STEP 5 ELSE GOTO STEP 8
STEP 8 : IF C=2 THEN PRINT NUM ; "IS PRIME"
STEP 9 : C=0 , J=1
STEP 10 : INCREMENT THE VALUE OF K BY 1
STEP 11: IF K<=N THEN GOTO STEP 4
END
Thnk u so much sir!!
ReplyDeleteRegards
BARNAK GHOSH
CLASS - 8 SECTION - C
Thank u sir
ReplyDelete