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. I scored 150 at 6 years old but now I got 110 and I'm 13

    Feb 26, 17 12:49 PM

    I scored 150 at 6 years old but now I got 110 and I'm 13...what's happening???

    Read More

  2. My Story with SBI

    Feb 22, 17 02:46 PM

    I have combined my passion with SBI to develop a constant stream of income besides my regular job. This is story of an average guy who loves to read books and shares his opinions.

    Read More

  3. Unbelievable intelligence and geniusness

    Feb 22, 17 09:25 AM

    Hi. I'm Antonio. I'm a 20 year old person and I took an IQ test just earlier tonight. I was informed that my IQ is 140. My IQ could be higher than that

    Read More