Posted by: Prajapati October 3, 2008
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++)
{ sum=sum+i;
counter++;
}
4)Get average
average = sum/counter;
Good luck