1.Assuming the precondition that the value associated with N is a positive integer, establish a loop invariant that leads to the conclusion that if the following routine terminates, then Sum is assigned the value 0 + 1 + c + N.
Sum = 0
K = 0
while (K :
K = K + 1
Sum = Sum + K
Provide an argument to the effect that the routine does in fact terminate.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here