Define a method named swap Values that takes an array of four integers as a parameter, swaps
Fantastic news! We've Found the answer you've been seeking!
Question:
Define a method named swap Values that takes an array of four integers as a parameter, swaps array elements at indices 0 and 1, and swaps array elements at indices 2 and 3. Then write a main program that reads four integers from input and stores the integers in an array in positions 0 to 3. The main program should call function swap Values() to swap array's values and print the swapped values on a single line separated with spaces. Ex: If the input is: 3824 function swap Values() returns and the main program outputs: 8342
Related Book For
Introduction to Algorithms
ISBN: 978-0262033848
3rd edition
Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest
Posted Date: