Skip to content

Commit ac402cc

Browse files
authored
Add files via upload
1 parent 82e7b5d commit ac402cc

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

05-09-21/sumofevennos.cpp

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#include<iostream>
2+
using namespace std;
3+
4+
5+
int main(){
6+
7+
int i, N, sum=0;
8+
cin>>N;
9+
10+
11+
for (i=1; i<=N; i++){
12+
if (i%2==0){
13+
sum=sum+i;
14+
}
15+
}
16+
cout<<sum;
17+
18+
}

0 commit comments

Comments
 (0)