Rakesh Reddy
New Member
How to find the given number is prime or not by using the automation anywhere
Hi krrish, i went through the logic you made to find prime number in attachment, i have a question here, that is, even when we assign value such as 6, 8, 10 to InputValue we get the reminder as 0 after loop and prompt assignment increased by 1 each time so 10 is divisible by 1 , 2, 5, 10. When prompt assignment value 2 we get reminder as 0 which leads increase in prime count and also prompt. But 10 itself is not prime number and still we get number prime number message in AA. Pls Correct me if im wrong.Try Attached
Hi krrish, i went through the logic you made to find prime number in attachment, i have a question here, that is, even when we assign value such as 6, 8, 10 to InputValue we get the reminder as 0 after loop and prompt assignment increased by 1 each time so 10 is divisible by 1 , 2, 5, 10. When prompt assignment value 2 we get reminder as 0 which leads increase in prime count and also prompt. But 10 itself is not prime number and still we get number prime number message in AA. Pls Correct me if im wrong.Try Attached
Hi Sridhar,
In your case,if 10 is input value,after loop "$vPrimeCount$" value will be "4"(as its divisible by 1,2,5,10 as you said).So it goes to ELSE Condition under IF and will give a msg box saying "10 is NOT PRIME".