Example 2: Summing Integers (p.59)
public static int (int n)
//post : compute the sum of 0..n
{
int result =0;
for (int I = 1; I <= n; I++)
{ result = result + 1; }
return result;
}
Previous slide
Next slide
Back to first slide
View graphic version