Posted by: yellow October 3, 2008
Java Help wanted
Login in to Rate this Post:     0       ?        
...and why is that difficult ?

int sum = 0;  // initilize sum to 0

// run thru the loop, 1 to 15 times, somehting like ( int i = 0; i<= 15; i++)
// now take the Mod of i , if its zero its even and if its 1 its odd.
// so add the every time mod i = 1;
// someting like if ( mod i = = 1)
    sum++; 

// end of loop, problem solved.


 
Read Full Discussion Thread for this article