SyntaxFix
Write A Post
Hire A Developer
Questions
You could also flip your if test:
foreach ( int number in numbers ) { if ( number >= 0 ) { //process number } }