Sum of primes!

So easy!!!

What is the sum of all primes between 1-100?

You can try My Other Problems .

1040 1080 1060 1020

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

5 solutions

Subodh Hegde
Aug 10, 2014

2+3+5+7+11+13+17+19+23+29+31+37+41+43+47+53+59+61+67+71+ 73+79+83+89+97 =1060

. .
Apr 28, 2021

Just see the capture.

Antonio Rangel
Nov 17, 2014

3+13+23+43+53+73+83=291

7+17+37+47+67+97=272

11+31+41+61+71=215

19+29+59+79+89=275

2+5=7

291+272+215+275+7=1060

Abhijith Asokan
Sep 12, 2014

C++ solution

include<iostream.h>

void main() { int n=2,sum=0,i; while(n<100) { for(i=2;i<n;i++) if(n%i==0) break; if(!(i<n)) sum+=n; n++; } cout<<"sum="<<sum; }

Nikhil Tandon
Aug 16, 2014

cout<<2+3+5+7+11+13+17+19+23+29+31+37+41+43+47+53+59+61+67+71+ 73+79+83+89+97 :D

isn't there a easier way

Shivanshu Deorani - 6 years, 9 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...