Click here to Skip to main content
15,891,657 members
Home / Discussions / C#
   

C#

 
AnswerRe: How do I incorporate these two routines? [modified] Pin
solutionsville24-Aug-07 17:54
solutionsville24-Aug-07 17:54 
GeneralRe: How do I incorporate these two routines? Pin
Big Daddy Farang27-Aug-07 10:03
Big Daddy Farang27-Aug-07 10:03 
AnswerRe: How do I incorporate these two routines? Pin
solutionsville27-Aug-07 12:32
solutionsville27-Aug-07 12:32 
GeneralRe: How do I incorporate these two routines? Pin
Big Daddy Farang27-Aug-07 12:39
Big Daddy Farang27-Aug-07 12:39 
Questiongetting infragistics Pin
starist24-Aug-07 9:12
starist24-Aug-07 9:12 
AnswerRe: getting infragistics Pin
Alaric_24-Aug-07 9:27
professionalAlaric_24-Aug-07 9:27 
GeneralRe: getting infragistics Pin
Dan Neely24-Aug-07 10:06
Dan Neely24-Aug-07 10:06 
QuestionI need a full stop Pin
humayunlalzad24-Aug-07 8:41
humayunlalzad24-Aug-07 8:41 
I want that after the last no. I should get a full stop instead of a comma.Pl correct my code.
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 < 2)
{
min = 2;
}
min = i;
max = j;
}
public IEnumerator GetEnumerator()
{
for (long possiblePrime = min; possiblePrime <= max; possiblePrime++)
{
bool isPrime = true;
for (long possibleFactor = 2; possibleFactor <=
(long)Math.Floor(Math.Sqrt(possiblePrime)); possibleFactor++)
{
long remainderAfterDivision = possiblePrime % possibleFactor;
if (remainderAfterDivision == 0)
{
isPrime = false;
break;
}
}
if (isPrime)
{
yield return possiblePrime;
}
}
}
}

class Program
{
static void Main(string[] args)
{
Primes myPrimes = new Primes(2,1000);
foreach (long i in myPrimes)
Console.Write("{0}{1} ",i,
(i==myPrimes.max )?".":",");
Console.ReadKey();
}
}
}
AnswerRe: I need a full stop Pin
PIEBALDconsult24-Aug-07 9:04
mvePIEBALDconsult24-Aug-07 9:04 
GeneralRe: I need a full stop Pin
Alaric_24-Aug-07 9:05
professionalAlaric_24-Aug-07 9:05 
AnswerRe: I need a full stop Pin
Alaric_24-Aug-07 9:04
professionalAlaric_24-Aug-07 9:04 
AnswerRe: I need a full stop Pin
PIEBALDconsult24-Aug-07 11:58
mvePIEBALDconsult24-Aug-07 11:58 
GeneralRe: I need a full stop Pin
martin_hughes24-Aug-07 11:49
martin_hughes24-Aug-07 11:49 
GeneralRe: I need a full stop Pin
humayunlalzad24-Aug-07 14:55
humayunlalzad24-Aug-07 14:55 
GeneralRe: I need a full stop Pin
PIEBALDconsult24-Aug-07 18:42
mvePIEBALDconsult24-Aug-07 18:42 
QuestionHELP WITH SKYNET!!! Pin
Alaric_24-Aug-07 8:30
professionalAlaric_24-Aug-07 8:30 
AnswerRe: help help help Pin
Alaric_24-Aug-07 8:34
professionalAlaric_24-Aug-07 8:34 
JokeRe: help help help Pin
PIEBALDconsult24-Aug-07 8:41
mvePIEBALDconsult24-Aug-07 8:41 
GeneralRe: help help help Pin
Alaric_24-Aug-07 8:48
professionalAlaric_24-Aug-07 8:48 
GeneralRe: help help help Pin
PIEBALDconsult24-Aug-07 9:07
mvePIEBALDconsult24-Aug-07 9:07 
GeneralRe: help help help [modified] Pin
Alaric_24-Aug-07 9:08
professionalAlaric_24-Aug-07 9:08 
AnswerRe: HELP WITH SKYNET!!! Pin
Dan Neely24-Aug-07 8:55
Dan Neely24-Aug-07 8:55 
GeneralRe: HELP WITH SKYNET!!! Pin
Alaric_24-Aug-07 8:58
professionalAlaric_24-Aug-07 8:58 
AnswerRe: HELP WITH SKYNET!!! Pin
Spacix One24-Aug-07 9:32
Spacix One24-Aug-07 9:32 
GeneralRe: HELP WITH SKYNET!!! Pin
PIEBALDconsult24-Aug-07 10:33
mvePIEBALDconsult24-Aug-07 10:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.