text: how can i get the prime numbers in a c# code??   similar to c++. you need to make a funtion for it, meaning you don't have a direct instruction for it. it's pretty easy. just take every number from 2 to ... and check if it only divides to itself and 1.