Click here to Skip to main content
15,912,756 members
Home / Discussions / C#
   

C#

 
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 
GeneralReport From DATASET Pin
21-May-05 6:44
suss21-May-05 6:44 
GeneralTransferring image from webservice to PPC Pin
Yeast2721-May-05 6:44
Yeast2721-May-05 6:44 
GeneralRe: Transferring image from webservice to PPC Pin
John Arlen122-May-05 14:56
John Arlen122-May-05 14:56 
GeneralRe: Transferring image from webservice to PPC Pin
Yeast2722-May-05 19:56
Yeast2722-May-05 19:56 
Questioncheckbox ? Pin
youssef21-May-05 5:04
youssef21-May-05 5:04 
AnswerRe: checkbox ? Pin
zhengdong jin21-May-05 6:04
zhengdong jin21-May-05 6:04 
GeneralMenustrip Selfmade Pin
Anonymous21-May-05 4:45
Anonymous21-May-05 4:45 
GeneralRe: Menustrip Selfmade Pin
Robert Rohde21-May-05 5:00
Robert Rohde21-May-05 5:00 
GeneralC# code to find Prime Numbers Pin
diabolusgorgon21-May-05 4:33
diabolusgorgon21-May-05 4:33 
GeneralRe: C# code to find Prime Numbers Pin
Robert Rohde21-May-05 4:46
Robert Rohde21-May-05 4:46 
GeneralRe: C# code to find Prime Numbers Pin
Asad Hussain21-May-05 10:43
Asad Hussain21-May-05 10:43 
HOMEWORK!!!!!

Here is the *simplest* algorithm

i - Loop through all odd numbers. That eliminates all even numbers which by definition CANNOT be prime.
ii - Write a function that loops thru from 3 - sqrt(number) and if the mod results in 0 at any point then that number is not a prime. No need to test dividing by 1 and 2 since every number can be divided by 1 and you have eliminated even numbers so no need to divide by 2. You could go up to n/2 but it is unnecessary. eg. you are testing 47 for prime:
* sqrt(47) = 7 (roughly)
* if any number from 3-7 cannot divide 47 then it is surely a prime so u tested 5 numbers instead of 24.
iii - Store every successfully tested number in some sort of collection.
iv - Iterate thru the collection and do the average


GeneralRe: C# code to find Prime Numbers Pin
diabolusgorgon21-May-05 13:31
diabolusgorgon21-May-05 13:31 
GeneralRe: C# code to find Prime Numbers Pin
Robert Rohde21-May-05 20:04
Robert Rohde21-May-05 20:04 

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.