Hi!
How can we print prime numbers from 1 to 10 using while loop
Thanks
Hi!
How can we print prime numbers from 1 to 10 using while loop
Thanks
There are multiple threads on this already. You can easily search the forum to find them.
One of the methods. Gives array of prime numbers
primeNumbers = Enumerable.Range(1, 10).Where(Function(n) (n > 1) AndAlso Enumerable.Range(2, n-1).Count(Function(m) n mod m = 0) = 1).ToArray
Cheers
Hi @404_Error
Do this:
Hope this helps,
Best Regards.
Hi,
i followed all the steps
i mentioned num<10. but it is still giving me the 11 number.
Thanks,
Hi,
Still it is giving me the 11
Hi!
I need it by using while condition.
If we managed to use ne while condition it could be more helpful
Thanks,
As per our discussion yesterday, I’m attaching the complete workflow. Please let us know if you find any further difficulty.
PrimeNumberGeneration.zip (144.2 KB)
Best Regards.
Thank you so much for your help
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.