Computer Science, asked by sudipto27, 11 months ago

Input any number. Check the number is prime or not. PLZ MAKE A ALGORITHM

Answers

Answered by Ayush26501
1

Step 1: Start

Step 2: Declare variables n,i,flag.

Step 3: Initialize variables

       flag←1

       i←2  

Step 4: Read n from user.

Step 5: Repeat the steps until i<(n/2)

           If remainder of n÷i equals 0

           flag←0

           Go to step 6

            i←i+1

Step 6: If flag=0

          Display n is not prime

       else

          Display n is prime

Step 7: Stop

Similar questions