Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Toyota Vitz scp10 For Sale
Lakmal Bandara
Updated:
Today at 10:50 AM
Ad icon
Cam ෂෝ කරන්න ආස කෙල්ලෝ
vip video seller srilanka
Updated:
Today at 2:17 AM
Cam show job
vip video seller srilanka
Updated:
Today at 2:01 AM
Vip විඩීයෝ තියේ හොරෙන් රෙකෝඩ් කරපුවා
vip video seller srilanka
Updated:
Today at 1:26 AM
Kandy
Welcome all my all new pet shop Bark.lk
dilumrane
Updated:
Monday at 12:26 PM
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Help
C Programmers Help Me!!!!
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="Im.Just.a.Fool" data-source="post: 4272141" data-attributes="member: 186898"><p>chamidilk</p><p></p><p>oya prime numbers check karana kramaya hari. n is a prime if it is not divisible by x (2 <= x <= sqrt<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite23" alt="(n)" title="Thumbs down (n)" loading="lazy" data-shortname="(n)" /> ) . ea range eke numbers walin n bedenawada kiyala check karana kramaya thamai fast ma method eka. iratte sankya check kale nathnam program eka thawath fast wenawa. Because there is a 50% chance that any given integer is divisible by 2. </p><p></p><p>[CODE]</p><p> [COLOR=Green]// This method assumes n is a non-negative integer, because </p><p> // prime numbers start with 2.[/COLOR]</p><p> boolean isPrime(int n) {</p><p> if (n < 2) return false; </p><p> if (n == 2) return true;</p><p> if (n % 2 == 0) return false;</p><p> for (int i = 3; i*i <= n; i+=2)</p><p> if (n % i == 0) return false;</p><p> return true;</p><p> }</p><p>[/CODE]</p></blockquote><p></p>
[QUOTE="Im.Just.a.Fool, post: 4272141, member: 186898"] chamidilk oya prime numbers check karana kramaya hari. n is a prime if it is not divisible by x (2 <= x <= sqrt(n) ) . ea range eke numbers walin n bedenawada kiyala check karana kramaya thamai fast ma method eka. iratte sankya check kale nathnam program eka thawath fast wenawa. Because there is a 50% chance that any given integer is divisible by 2. [CODE] [COLOR=Green]// This method assumes n is a non-negative integer, because // prime numbers start with 2.[/COLOR] boolean isPrime(int n) { if (n < 2) return false; if (n == 2) return true; if (n % 2 == 0) return false; for (int i = 3; i*i <= n; i+=2) if (n % i == 0) return false; return true; } [/CODE] [/QUOTE]
Insert quotes…
Verification
Haya warak paha keeyada? (haya wadi kireema paha)
Post reply
Top
Bottom