Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Summation Of Primes
# include<iostream> # define size 1000 //size is the number till which you want to find sum prime numbers using namespace std; int main() { bool check[size]; long long int sum=0; long long int count=0; for(int i=0 ; i<size ; i++) check[i]=true; check[0]=false; check[1]=false; for(int i=1 ; i<size ; i++) if(check[i]) { for(int k=2*i ; k<size ; k+=i) check[k]=false; sum+=i; count++; } cout<<"Sum of primes :"<<sum; return 0; }
run
|
edit
|
history
|
help
0
remove_30-Seconds-of-C++
union of two sorted array
StrStrPbrk
test
Longest Consecutive Subsequence
avx2 optimized pcg32 random number generator
/
nobita's candies problem
matrix
Precendence of Pointer Indirection Example