using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Ch11Ex03yield
{
public class Primes
{
private long min;
public long max;
public Primes()
: this(2, 100)
{
}
public Primes(long i, long j)
{
if (i %26lt; 2)
{
min = 2;
}
min = i;
max = j;
}
public IEnumerator GetEnumerator()
{
for (long possiblePrime = min; possiblePrime %26lt;= max; possiblePrime++)
{
bool isPrime = true;
for (long possibleFactor = 2; possibleFactor %26lt;=
(long)Math.Floor(Math.Sqrt(possiblePrime... possibleFactor++)
{
long remainderAfterDivision = possiblePrime % possibleFactor;
if (remainderAfterDivision == 0)
{
C# code I need a full stop?
full stop? not really sure what that is, assuming you want the code to exit depending from a function or just out of a loop or to skip the current iteration in the loop.
you should use
break - stops execution
continue - skips current iteration
return - returns from calling method
chrysanthemum
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment