Instructions
Press "Start" and then select "Pkmn." Select your Magikarp and move him up to the top of the list. Press "B" twice.
Walk over any patch of grass until a random encounter occurs.
Select "Pkmn" the moment you have control in the battle. Swap out your Magikarp for any other Pokemon.
Fight the battle as normal, using the other Pokemon's moves to defeat the wild Pokemon. Because Magikarp made an appearance and did not faint during the battle, it will still gain experience as if it fought the wild Pokemon.
Keep battling wild Pokemon until Magikarp reaches level 20. When Magikarp is level 20, it will evolve to Gyarados.