Thursday, November 12, 2020

 ALGORITHM :

-------------------------

1. TO INPUT A NUMBER AND CHECK WHETHER A NUMBER IS PRIME NUMBER OR NOT.


START 

STEP 1: DECLARE THE VARIABLES  J , C AND NUM  AS INTEGER

STEP 2: J=1 , C=0 , NUM=0

STEP 3: INPUT "ENTER THE VALUE OF NUMBER"; NUM

STEP 4: IF NUM % J=0 THEN C=C+1

STEP 5: INCREAMENT THE VALUE OF J BY 1

STEP 6:  IF J<=NUM THEN GOTO STEP 4 ELSE GOTO STEP 7

STEP 7 : IF C=2 THEN PRINT NUM; "IS PRIME " ELSE PRINT NUM ; "IS NOT PRIME"

END


1 comment:

  1. Tioga Wire | Tithron Technologies Co.
    Tioga titanium fat bike Wire is the innovative device for electronic devices and titanium 4000 electronics. Tioga tittanium Wire allows you to apple watch titanium use your smartphone as can titanium rings be resized your keyboard.

    ReplyDelete

  3.WAP IN JAVA TO INPUT THREE NUMBERS AND COUNT HOW MANY OF THEM ARE EVEN .   import java.util.*; class Prog {   public static ...