Finding the given number is prime or not

VJR

Well-Known Member
Hi Rakesh Reddy,

What have you implemented so far in the Task to check for a prime number and where is the stoppage you are facing?
 

Shridhar

New Member
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.
 

Shridhar

New Member
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.
 

krrish9199

New Member
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".
 
Top