BEGIN
Prompt user to enter 4 numbers
Use the variable i to be your current number
Use equation n ( i + 1 )
Make code to go through each number and compare i to the next number n
If i<n
Go to next number and compare
If i>n
Replace value of i with n and compare next number
Loop until i is not replaced with n
END
This is probably not the greatest way to go about it but it made sense to me. Once I am more familiar with coding I can come back and make any necessary corrections.
This is a very good attempt.
ReplyDelete1. I did not understand the use of equation n(i+1).
2. Argue that this will terminate in finite time.
3. Argue that this will always give the correct result.
-Aviral