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
co_assign_1_ques_1
factor
Raw AVL
SEJM BLURWA
Filtering a vector attribute with template UnaryPredicate
ConversionOperator
ProdPriceEnum
DoubleListInt
informatika / Cinta Avrille X MIPA 5
cppPyDicCom