Skip to content

Instantly share code, notes, and snippets.

@shohan4556
Created October 4, 2014 15:13
Show Gist options
  • Save shohan4556/97ec5b5fd00423a5205e to your computer and use it in GitHub Desktop.
Save shohan4556/97ec5b5fd00423a5205e to your computer and use it in GitHub Desktop.
#include<stdio.h>
int main()
{
int i,j;
int long long sum=0;
int const long long num=2000000;
for(i=1;i<=num;i++){
for(j=2;j<i;j++){
if(i%j==0)
break;
} // child loop
if(i==j)
sum=sum+i;
} // parrent loop
printf(" The sum of prime Number below %lld is %lld \n\n",num,sum);
} //end main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment