When Program Does Not Loop

Unfortunately, Will is right. Not only that, but the condition in line 140 that Z>0 means that when numbers are not swapped, the program does not loop back. The final output is therefore 41563 - not quite what you hoped for! (Unless working in ring of numbers modulo 4, in which case I suppose they are in ascending order; ignore this if you don't have a mathematical background!) This is probably not the best example of the kind of test you are trying to demonstrate.

Click here to post comments

Join in and write your own page! It's easy to do. How? Simply click here to return to views.

Recent Articles

  1. Gary Smalley personality test

    Oct 18, 17 03:58 AM

    Gary Smalley personality test reveals four types of personalities. Take it to know your type

    Read More

  2. Myers Briggs Personality Tests

    Oct 16, 17 02:36 AM

    A brief note on characteristics of Myers Briggs Personality Tests

    Read More

  3. Graduate aptitude test in engineering

    Oct 09, 17 03:34 PM

    Graduate aptitude test in engineering serves to be a qualifying test for several PSUs such as NTPC, BHEL, IOCL, etc.

    Read More