Create an Array of 50 integers. Write a simple function to seach the inputted integer in the array. If the integer is found in the array return the index of that integer in that array. If integer is not found in the array just return -1 from that function.
Now you have got the index of the number. Write another function to swap the elements in the same array from 0 to the index you have found. Supply the array and the index to that function to swap the elemets.
If the element is not found in the array just supply the array and 49 to that function. It will swap all the elements in the array except the first element. And assing the inputted element to
Array[0] = element;
Reputation Points: 9
Solved Threads: 1
Junior Poster in Training
Offline 91 posts
since Sep 2004