Posted by: techGuy October 3, 2008
Java Help wanted
Login in to Rate this Post:     0       ?        

Try this one,

1) Initialize sum=0

2)Initialize counter=0

3)Initialize average=0

3)Get the sum from 1 to 15

for(int i=1; i<=15; i=i+2)

{ sum=sum+i;

counter++;

}

4)Get average

average = sum/counter;

Good luck

  Alchi laagyo

Read Full Discussion Thread for this article