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

C#

 
GeneralNetworkStream and TCPClient problem.. Please help Pin
jbergetun21-May-05 15:02
jbergetun21-May-05 15:02 
GeneralRe: NetworkStream and TCPClient problem.. Please help Pin
Marc Clifton21-May-05 15:18
mvaMarc Clifton21-May-05 15:18 
GeneralRe: NetworkStream and TCPClient problem.. Please help Pin
jbergetun22-May-05 0:38
jbergetun22-May-05 0:38 
GeneralRe: NetworkStream and TCPClient problem.. Please help Pin
Marc Clifton22-May-05 1:37
mvaMarc Clifton22-May-05 1:37 
GeneralCannot convert from stream to DirectX Audio Pin
Anthony Mushrow21-May-05 14:10
professionalAnthony Mushrow21-May-05 14:10 
GeneralC# Code to find the average of prime numbers between 1-100 Pin
diabolusgorgon21-May-05 14:06
diabolusgorgon21-May-05 14:06 
GeneralRe: C# Code to find the average of prime numbers between 1-100 Pin
diabolusgorgon21-May-05 15:03
diabolusgorgon21-May-05 15:03 
GeneralRe: C# Code to find the average of prime numbers between 1-100 Pin
Marc Clifton21-May-05 15:24
mvaMarc Clifton21-May-05 15:24 
Well, an average is the sum of the numbers divided by how many numbers there are. You already know how many primes there are (ulong primes), you just need another variable to total them inside the same loop (the last loop). Then, after the loop exists, compute the average.

I'd rather not show you the exact code, because you're supposed to learn something.

BTW, the comment "Assign all those mutiples of 2 and 3 to be 'false'" should either read "Assign multiples of 2 to be false for all numbers", or "assign multiples of 2, 3, ... up to topNumber to be false".

And also, it's sort of pointless to assign multiples of i where i > topNumber / 2, since any multiples are outside of the range of the array.

Most of programming is NOT coding, it's figuring out the algorithm. Good luck!

Marc

My website
GeneralRe: C# Code to find the average of prime numbers between 1-100 Pin
Robert Rohde21-May-05 20:43
Robert Rohde21-May-05 20:43 
GeneralNetworks questions Pin
felopater21-May-05 12:38
felopater21-May-05 12:38 
QuestionIs C# for engineers? Pin
amitmohanty21-May-05 12:32
amitmohanty21-May-05 12:32 
AnswerRe: Is C# for engineers? Pin
Colin Angus Mackay21-May-05 12:45
Colin Angus Mackay21-May-05 12:45 
GeneralRe: Is C# for engineers? Pin
amitmohanty21-May-05 13:13
amitmohanty21-May-05 13:13 
GeneralRe: Is C# for engineers? Pin
Colin Angus Mackay21-May-05 13:16
Colin Angus Mackay21-May-05 13:16 
GeneralRe: Is C# for engineers? Pin
amitmohanty21-May-05 13:30
amitmohanty21-May-05 13:30 
GeneralRe: Is C# for engineers? Pin
eggie521-May-05 14:39
eggie521-May-05 14:39 
GeneralRe: Is C# for engineers? Pin
amitmohanty21-May-05 14:44
amitmohanty21-May-05 14:44 
GeneralRe: Is C# for engineers? Pin
ekynox21-May-05 15:18
ekynox21-May-05 15:18 
GeneralBuilding option get hidden!!! :O Pin
amitmohanty21-May-05 8:55
amitmohanty21-May-05 8:55 
GeneralRe: Building option get hidden!!! :O Pin
MoustafaS21-May-05 11:21
MoustafaS21-May-05 11:21 
GeneralRe: Building option get hidden!!! :O Pin
amitmohanty21-May-05 11:48
amitmohanty21-May-05 11:48 
GeneralRe: Building option get hidden!!! :O Pin
MoustafaS21-May-05 12:02
MoustafaS21-May-05 12:02 
GeneralRe: Building option get hidden!!! :O Pin
amitmohanty21-May-05 12:30
amitmohanty21-May-05 12:30 
GeneralRe: Building option get hidden!!! :O Pin
MoustafaS21-May-05 13:02
MoustafaS21-May-05 13:02 
GeneralRe: Building option get hidden!!! :O Pin
amitmohanty21-May-05 13:56
amitmohanty21-May-05 13:56 

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.