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. How much is the National Aptitude test vital for your job?

    Dec 10, 17 01:44 PM

    The National Aptitude test in the USA has been designed to deal with the increasing unemployment rate and mismatch of workers with their respective jobs in the United States.

    Read More

  2. IELTS Preparation and Emotional Intelligence

    Dec 06, 17 04:55 AM

    IELTS Preparation without strengthening your emotional intelligence may lead you to a failure. You need to be mentally strong to tackle IELTS successfully.

    Read More

  3. IELTS Preparation Online

    Dec 04, 17 02:10 PM

    International applicants need to score 7 bands in academic section to get admitted at Harvard and other universities. IELTS preparation online can play wonders when you are press for time and money

    Read More