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. What is an accurate personality test?

    Jan 08, 20 03:45 AM

    Various personality tests claim to be the best tools. However, none of them can be termed as an accurate personality test. Some may be closer to accuracy.

    Read More

  2. IQ vs knowledge

    Jan 01, 20 02:15 AM

    I score barely above average on IQ tests but in all around knowledge tests I score in the 90's. Average is 95. So would one's employer prefer knowledge

    Read More

  3. Animal Personality Test May Discover Animal in You

    Dec 09, 19 01:24 PM

    Animal personality test is a fun test. You can identify what kind of animal attitude you have.

    Read More