Click here to Skip to main content
15,888,286 members
Home / Discussions / C#
   

C#

 
QuestionTrouble handling DeviceIoControl to retrieve USN data Pin
Mandelnuss3-Jan-15 0:46
Mandelnuss3-Jan-15 0:46 
AnswerRe: Trouble handling DeviceIoControl to retrieve USN data Pin
Richard MacCutchan3-Jan-15 0:57
mveRichard MacCutchan3-Jan-15 0:57 
GeneralRe: Trouble handling DeviceIoControl to retrieve USN data Pin
Mandelnuss3-Jan-15 1:18
Mandelnuss3-Jan-15 1:18 
GeneralRe: Trouble handling DeviceIoControl to retrieve USN data Pin
Richard MacCutchan3-Jan-15 1:50
mveRichard MacCutchan3-Jan-15 1:50 
GeneralRe: Trouble handling DeviceIoControl to retrieve USN data Pin
Mandelnuss3-Jan-15 3:53
Mandelnuss3-Jan-15 3:53 
GeneralRe: Trouble handling DeviceIoControl to retrieve USN data Pin
Richard MacCutchan3-Jan-15 4:46
mveRichard MacCutchan3-Jan-15 4:46 
GeneralRe: Trouble handling DeviceIoControl to retrieve USN data Pin
Mandelnuss3-Jan-15 5:20
Mandelnuss3-Jan-15 5:20 
QuestionLogic of prime numbers Pin
Member 113371082-Jan-15 12:44
Member 113371082-Jan-15 12:44 
C#
if (value % 2 == 0) { x++; break; }
if (value % i == 0) { x++; break; }


Heres my problem with this. I am not understanding the logic and I need help with this. I would really appreciate your feedback.

Just as an example.
suppose i input value=5
i is going to check 1,3,5.
so 5%1= Remainder 0
5%3= Remainder 2
5%5= Remainder 0
Well since 5%3 has a remainder, doesnt this disqualify it? Obviously we all know that five is a prime number but what is the computer checking with the module??

Thank you guys so much and I hope you guys can teach me the logic behind this.
AnswerRe: Logic of prime numbers Pin
BillWoodruff2-Jan-15 13:14
professionalBillWoodruff2-Jan-15 13:14 
GeneralRe: Logic of prime numbers Pin
Richard MacCutchan2-Jan-15 22:03
mveRichard MacCutchan2-Jan-15 22:03 
GeneralRe: Logic of prime numbers Pin
Pete O'Hanlon2-Jan-15 23:23
mvePete O'Hanlon2-Jan-15 23:23 
GeneralRe: Logic of prime numbers Pin
BillWoodruff3-Jan-15 0:42
professionalBillWoodruff3-Jan-15 0:42 
GeneralRe: Logic of prime numbers Pin
Richard MacCutchan3-Jan-15 0:47
mveRichard MacCutchan3-Jan-15 0:47 
GeneralRe: Logic of prime numbers Pin
BillWoodruff3-Jan-15 11:57
professionalBillWoodruff3-Jan-15 11:57 
GeneralRe: Logic of prime numbers Pin
Richard MacCutchan3-Jan-15 21:05
mveRichard MacCutchan3-Jan-15 21:05 
GeneralRe: Logic of prime numbers Pin
BillWoodruff3-Jan-15 21:21
professionalBillWoodruff3-Jan-15 21:21 
GeneralRe: Logic of prime numbers Pin
Richard MacCutchan3-Jan-15 22:02
mveRichard MacCutchan3-Jan-15 22:02 
AnswerRe: Logic of prime numbers Pin
SledgeHammer012-Jan-15 14:16
SledgeHammer012-Jan-15 14:16 
GeneralRe: Logic of prime numbers Pin
Member 113371082-Jan-15 14:19
Member 113371082-Jan-15 14:19 
GeneralRe: Logic of prime numbers Pin
SledgeHammer012-Jan-15 14:32
SledgeHammer012-Jan-15 14:32 
GeneralRe: Logic of prime numbers Pin
Member 113371082-Jan-15 15:06
Member 113371082-Jan-15 15:06 
GeneralRe: Logic of prime numbers Pin
SledgeHammer012-Jan-15 15:24
SledgeHammer012-Jan-15 15:24 
GeneralRe: Logic of prime numbers Pin
BillWoodruff3-Jan-15 11:59
professionalBillWoodruff3-Jan-15 11:59 
Questionhow can get number in a string in c# :(((((( Pin
mhd.sbt2-Jan-15 6:13
mhd.sbt2-Jan-15 6:13 
AnswerRe: how can get number in a string in c# :(((((( Pin
Pete O'Hanlon2-Jan-15 6:28
mvePete O'Hanlon2-Jan-15 6:28 

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.