How can we check if a given number is prime?

I have tried some logic as it was in the attached oml..kindly go through and suggest me the right way to 

execute the logic.

here are my doubts:

-> In the foreach loop , is it right to assign the Recordlist??

Hi Varada,

Can you please explain what you wants to achieve?

Because just to find prime number why you need record list?


Hello Rajan,

 No needd to use for eachloop, You can use If condition to repeat loop to check Prime or Not. Find the below Logic snap.


Dear Abilash,

Thanks for your clear solution and also a clear oml file which has the logic.