What do you want to save?
Add Code snippet
New code examples
-
CSS 2021-11-20 03:20:25
sieve of eratosthenes
// C++ program to print all primes smaller than or equal to // n using Sieve of Eratosthenes #include <bits/stdc++.h> using namespace std; void SieveOfEratosthenes(int n) { // Create a boolean array "prime[0..n]" and initialize /... Add solution -
Javascript 2021-11-05 16:33:16
javascript prime numbers up till a certain number
// prime numbers from zero up till a certain number const sumPrimes = (num) => { let primes=[]; // computing prime numbers from 0 uptill a number num for (let i = 0; i <= num; i++) { let flag = 0; // looping through 2 to ... Add solution -
C++ 2021-10-14 05:24:07
how to get the prime number in c++ where time complexity is 0(log n)
// C++ program to print all primes smaller than or equal to // n using Sieve of Eratosthenes #include <bits/stdc++.h> using namespace std; void SieveOfEratosthenes(int n) { // Create a boolean array "prime[0..n]" and initialize /... Add solution -
C++ 2021-10-07 16:11:02
sieve of eratosthenes c++
// C++ program to print all primes smaller than or equal to // n using Sieve of Eratosthenes #include <bits/stdc++.h> using namespace std; void SieveOfEratosthenes(int n) { // Create a boolean array "prime[0..n]" and initialize /... Add solution -
Javascript 2021-09-22 04:43:01
sieve of eratosthenes
// C++ program to print all primes smaller than or equal to // n using Sieve of Eratosthenes #include <bits/stdc++.h> using namespace std; void SieveOfEratosthenes(int n) { // Create a boolean array "prime[0..n]" and initialize /... Add solution