Using System;
Namespace Loops
{
Class Program
{
static void Main (string[] args)
{
/* local variable definition */
int I, J;
for (i = 2; i <; i++)
{
for (j = 2; J <= I/j; j + +)
if ((i% j) = = 0) break;//If found, it is not prime
if (J > (i/j))
Console.WriteLine ("{0} is prime number/n", I);
}
Console.ReadLine ();
}
}
}
The first blog, but also the first contact with C #, before the school on the programming of the content of C language, but has not been exposed to these three years, and now re-start learning programming, hope everything is not too late. Let the blog park to record my and C # growth path it.
Now just remember to learn C before writing the method of seeking prime numbers, but that method of efficiency is simply low to explode, today in the C # program, see a very fast method, just beginning also leng a bit, although in other people's view should be a very simple method, but I do not, so still want to lose the slowly learn.
Learn to ask for a prime number today.
Don't forget beginner's mind
Programming &blog Virgo-using C # to find prime numbers within 100