15,394,559 members
Home / Discussions / Algorithms

# Algorithms

 Re: Algorithm to find a given number is prime or not. harold aptroot6-Sep-14 4:10 harold aptroot 6-Sep-14 4:10
 Re: Algorithm to find a given number is prime or not. Member 110631236-Sep-14 4:14 Member 11063123 6-Sep-14 4:14
 Re: Algorithm to find a given number is prime or not. Member 110631236-Sep-14 4:18 Member 11063123 6-Sep-14 4:18
 Re: Algorithm to find a given number is prime or not. harold aptroot6-Sep-14 4:49 harold aptroot 6-Sep-14 4:49
 Re: Algorithm to find a given number is prime or not. Member 110631236-Sep-14 6:33 Member 11063123 6-Sep-14 6:33
 Re: Algorithm to find a given number is prime or not. harold aptroot6-Sep-14 7:22 harold aptroot 6-Sep-14 7:22
 Re: Algorithm to find a given number is prime or not. Member 110631236-Sep-14 7:53 Member 11063123 6-Sep-14 7:53
 Re: Algorithm to find a given number is prime or not. Member 110631237-Sep-14 6:23 Member 11063123 7-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.
 Re: Algorithm to find a given number is prime or not. Member 110631237-Sep-14 6:23 Member 11063123 7-Sep-14 6:23
 Re: Algorithm to find a given number is prime or not. Richard MacCutchan6-Sep-14 5:06 Richard MacCutchan 6-Sep-14 5:06
 Re: Algorithm to find a given number is prime or not. PIEBALDconsult14-Nov-14 3:37 PIEBALDconsult 14-Nov-14 3:37
 How to describe method: SQL for frequent pattern discovery pseudogrammaton4-Sep-14 18:01 pseudogrammaton 4-Sep-14 18:01
 Re: How to describe method: SQL for frequent pattern discovery Bernhard Hiller4-Sep-14 20:52 Bernhard Hiller 4-Sep-14 20:52
 Re: How to describe method: SQL for frequent pattern discovery pseudogrammaton5-Sep-14 2:55 pseudogrammaton 5-Sep-14 2:55
 Boundless Binary Search Gregorius van den Hoven27-Aug-14 10:24 Gregorius van den Hoven 27-Aug-14 10:24
 Re: Boundless Binary Search harold aptroot4-Sep-14 21:28 harold aptroot 4-Sep-14 21:28
 Re: Boundless Binary Search Gregorius van den Hoven6-Sep-14 10:04 Gregorius van den Hoven 6-Sep-14 10:04
 Re: Boundless Binary Search harold aptroot6-Sep-14 11:10 harold aptroot 6-Sep-14 11:10
 Re: Boundless Binary Search Gregorius van den Hoven6-Sep-14 12:32 Gregorius van den Hoven 6-Sep-14 12:32
 Re: Boundless Binary Search harold aptroot6-Sep-14 12:52 harold aptroot 6-Sep-14 12:52
 Re: Boundless Binary Search Gregorius van den Hoven6-Sep-14 15:07 Gregorius van den Hoven 6-Sep-14 15:07
 Re: Boundless Binary Search harold aptroot6-Sep-14 20:25 harold aptroot 6-Sep-14 20:25
 Re: Boundless Binary Search Alan Balkany5-Nov-15 0:21 Alan Balkany 5-Nov-15 0:21
 Surface calculation (sphere) - projection effect. [SOLVED ?] V.3-Aug-14 22:31 V. 3-Aug-14 22:31
 Re: Surface calculation (sphere) - projection effect. [SOLVED ?] Supreme Master27-Jul-15 9:24 Supreme Master 27-Jul-15 9:24
 Last Visit: 31-Dec-99 18:00     Last Update: 13-Aug-22 12:19 Refresh ᐊ Prev1...49505152535455565758 Next ᐅ