Computer Science, asked by oldisgold29, 1 year ago

BRAINLIST QUESTION 40 POINTS ​

Attachments:

Answers

Answered by sureshsharma4084
2
The algorithm to check whether a given number is a twisted prime number is given below.

Algorithm:-

STEP 1: START

STEP 2: DEFINE n, reverse, flag

STEP 3: SET sum = 0

STEP 4: ENTER n

STEP 5: REPEAT STEP 6 to 8 UNTIL (n!=0)

STEP 6: reverse = n%10

STEP 7: sum = sum*10 + reverse

STEP 8: n = n/10

STEP 9: SET flag =0

STEP 10: REPEAT STEP 11 UNTIL j<=sum/2

STEP 11: if(sum%j)==0

then..,,
set flag = 1
break

STEP 12: if(flag==0)
then PRINT "yes"
else
PRINT "no"

STEP 13: END

Hope it will help you!!

sureshsharma4084: will not bother to help you!!
sureshsharma4084: any more not even a thanks!!
Answered by ItzMiracle
2

\huge\underbrace\mathrm\purple{Answer}

The algorithm to check whether a given number is a twisted prime number is given below.

Algorithm:-

STEP 1: START

STEP 2: DEFINE n, reverse, flag

STEP 3: SET sum = 0

STEP 4: ENTER n

STEP 5: REPEAT STEP 6 to 8 UNTIL (n!=0)

STEP 6: reverse = n%10

STEP 7: sum = sum*10 + reverse

STEP 8: n = n/10

STEP 9: SET flag =0

STEP 10: REPEAT STEP 11 UNTIL j<=sum/2

STEP 11: if(sum%j)==0

then..,,

set flag = 1

break

STEP 12: if(flag==0)

then PRINT "yes"

else

PRINT "no"

STEP 13: END

Similar questions