Step 1 : Start
Step 2 : Read Num1, Num2
Step 3 : i = 2,j = 2,flag1 = 0,flag2 = 0
Step 4 : if i <= Num1 / 2 then go to Step 5
else go to Step 8
Step 5 : if Num1 % i = 0 then go to Step 6
else go to Step 7
Step 6 : flag1 = 1 ,then go to Step 14
Step 7 : i = i + 1 , then go to Step 4
Step 8 : if j <= Num2 / 2 then go to Step 9
else go to Step 13
Step 9 : if Num2 % i = 0 then go to Step 10
else go to Step 11
Step 10 : flag2 = 1 ,then go to Step 14
Step 11 : i = i + 1 , then go to Step 8
Step 12 : if flag1 = 0 and flag2 = 0 then go to Step 13
else go to Step 14
Step 13 : if Num1 - Num2 = 2 or Num2 - Num1 = 2 go to Step 15
else go to Step 14
Step 14 : print "Numbers are not Twins Prime" ,go to Step 16
Step 15 : print "Numbers are Twins Prime" ,go to Step 16
Step 16 : Stop
else go to Step 8
Step 5 : if Num1 % i = 0 then go to Step 6
else go to Step 7
Step 6 : flag1 = 1 ,then go to Step 14
Step 7 : i = i + 1 , then go to Step 4
Step 8 : if j <= Num2 / 2 then go to Step 9
else go to Step 13
Step 9 : if Num2 % i = 0 then go to Step 10
else go to Step 11
Step 10 : flag2 = 1 ,then go to Step 14
Step 11 : i = i + 1 , then go to Step 8
Step 12 : if flag1 = 0 and flag2 = 0 then go to Step 13
else go to Step 14
Step 13 : if Num1 - Num2 = 2 or Num2 - Num1 = 2 go to Step 15
else go to Step 14
Step 14 : print "Numbers are not Twins Prime" ,go to Step 16
Step 15 : print "Numbers are Twins Prime" ,go to Step 16
Step 16 : Stop
No comments:
Post a Comment