Question: The following algorithm checks and displays whether an inputted number is prime or not. STEP 1 : START STEP 2 : ENTER A POSITIVE INTEGER,
The following algorithm checks and displays whether an inputted number is prime or not.
STEP : START
STEP : ENTER A POSITIVE INTEGER, N
STEP : SET I AND SET DIVS
STEP : IF I N GO TO STEP ELSE GO TO STEP
STEP : IF I DIVIDES N THEN DIVS DIVS
STEP : I I AND GO TO STEP
STEP : IF DIVS THEN PRINT N IS COMPOSITE ELSE PRINT N IS PRIME
STEP : STOP
Convert the above algorithm into a flowchart, and test it using hand calculations for the numbers
and
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
