Skip to content

Commit a06bab0

Browse files
Create sum of odd.java
1 parent 4beb6a5 commit a06bab0

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

sum of odd.java

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class table{
2+
public static void main(String[]args){
3+
4+
int num = 200, odd = 0;
5+
// increment i by 2 starting 1 then 3 , 5
6+
for(int i = 1; i<= num; i = i+2 ) {
7+
8+
odd += i ;
9+
10+
}
11+
System.out.print(odd+ " ");
12+
}
13+
}

0 commit comments

Comments
 (0)