Skip to content

Commit df6b907

Browse files
Merge pull request #435 from ladyinblack/ladyinblack
Added count-odd-numbers-in-an-interval-range-1523
2 parents 9ea9efb + f08492e commit df6b907

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
public class Solution {
2+
public int CountOdds(int low, int high) {
3+
int count = 0;
4+
for (int i = low; i <= high; i++)
5+
if (i % 2 == 1)
6+
count++;
7+
8+
return count;
9+
}
10+
}

0 commit comments

Comments
 (0)