Click here to Skip to main content
15,353,606 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Algorithm to find a given number is prime or not. Pin
harold aptroot6-Sep-14 4:10
Memberharold aptroot6-Sep-14 4:10 
GeneralRe: Algorithm to find a given number is prime or not. Pin
Member 110631236-Sep-14 4:14
MemberMember 110631236-Sep-14 4:14 
GeneralRe: Algorithm to find a given number is prime or not. Pin
Member 110631236-Sep-14 4:18
MemberMember 110631236-Sep-14 4:18 
GeneralRe: Algorithm to find a given number is prime or not. Pin
harold aptroot6-Sep-14 4:49
Memberharold aptroot6-Sep-14 4:49 
GeneralRe: Algorithm to find a given number is prime or not. Pin
Member 110631236-Sep-14 6:33
MemberMember 110631236-Sep-14 6:33 
GeneralRe: Algorithm to find a given number is prime or not. Pin
harold aptroot6-Sep-14 7:22
Memberharold aptroot6-Sep-14 7:22 
GeneralRe: Algorithm to find a given number is prime or not. Pin
Member 110631236-Sep-14 7:53
MemberMember 110631236-Sep-14 7:53 
GeneralRe: Algorithm to find a given number is prime or not. Pin
Member 110631237-Sep-14 6:23
MemberMember 110631237-Sep-14 6:23 
i found the soltion: The flag value can either be 1 or 0 in the course of this program. Flag is just a variable. This is tested in step 7 to determine if the number is prime or not prime. flag value is initially set to 1(during initialization). It may or may not change at step 6 depending on whether rem=0. The value of rem is 0 when the result of the calculation at step 5 is 0 (happens when the division produces no reminder). as you know by doing num mod i we divide num by the current value of i and check the reminder. If the reminder is 0 that means num is divisible by i. So num cannot be a prime. Whenever we find that reminder is 0 we set value of flag=0 which means the number is not prime.
GeneralRe: Algorithm to find a given number is prime or not. Pin
Member 110631237-Sep-14 6:23
MemberMember 110631237-Sep-14 6:23 
AnswerRe: Algorithm to find a given number is prime or not. Pin
Richard MacCutchan6-Sep-14 5:06
mveRichard MacCutchan6-Sep-14 5:06 
AnswerRe: Algorithm to find a given number is prime or not. Pin
PIEBALDconsult14-Nov-14 3:37
professionalPIEBALDconsult14-Nov-14 3:37 
QuestionHow to describe method: SQL for frequent pattern discovery Pin
pseudogrammaton4-Sep-14 18:01
Memberpseudogrammaton4-Sep-14 18:01 
AnswerRe: How to describe method: SQL for frequent pattern discovery Pin
Bernhard Hiller4-Sep-14 20:52
MemberBernhard Hiller4-Sep-14 20:52 
GeneralRe: How to describe method: SQL for frequent pattern discovery Pin
pseudogrammaton5-Sep-14 2:55
Memberpseudogrammaton5-Sep-14 2:55 
QuestionBoundless Binary Search Pin
Gregorius van den Hoven27-Aug-14 10:24
MemberGregorius van den Hoven27-Aug-14 10:24 
GeneralRe: Boundless Binary Search Pin
harold aptroot4-Sep-14 21:28
Memberharold aptroot4-Sep-14 21:28 
GeneralRe: Boundless Binary Search Pin
Gregorius van den Hoven6-Sep-14 10:04
MemberGregorius van den Hoven6-Sep-14 10:04 
GeneralRe: Boundless Binary Search Pin
harold aptroot6-Sep-14 11:10
Memberharold aptroot6-Sep-14 11:10 
GeneralRe: Boundless Binary Search Pin
Gregorius van den Hoven6-Sep-14 12:32
MemberGregorius van den Hoven6-Sep-14 12:32 
GeneralRe: Boundless Binary Search Pin
harold aptroot6-Sep-14 12:52
Memberharold aptroot6-Sep-14 12:52 
GeneralRe: Boundless Binary Search Pin
Gregorius van den Hoven6-Sep-14 15:07
MemberGregorius van den Hoven6-Sep-14 15:07 
GeneralRe: Boundless Binary Search Pin
harold aptroot6-Sep-14 20:25
Memberharold aptroot6-Sep-14 20:25 
AnswerRe: Boundless Binary Search Pin
Alan Balkany5-Nov-15 0:21
MemberAlan Balkany5-Nov-15 0:21 
QuestionSurface calculation (sphere) - projection effect. [SOLVED ?] Pin
V.3-Aug-14 22:31
professionalV.3-Aug-14 22:31 
AnswerRe: Surface calculation (sphere) - projection effect. [SOLVED ?] Pin
Supreme Master27-Jul-15 9:24
MemberSupreme Master27-Jul-15 9:24 

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.