title: Return in if statement
body: <p>I've been coding a text adventure game in C#. I want to do a scene where you encounter a pokemon. I want to have 3 random pokemon to encounter, and I made a method that returns the name of the pokemon you find. Code is:    </p>
  
  <pre><code>public string choosePokemon()  
  {  
      Random random = new Random();  
      int pokemonChosen = random.Next();  
      if (pokemonChosen == 1)  
      {  
          string pokemon = "Pidgey";  
          return pokemon;  
      }  
      if (pokemonChosen == 2)   
      {  
          string pokemon = "Charmander";  
          return pokemon;  
      }  
      if (pokemonChosen == 3)  
      {  
          string pokemon = "Geodude";  
          return pokemon;  
      }  
      return "missingno";  
  } 
  </code></pre>
  
  <p>Whenever I execute the code it says "You encountered a missingno!". I want it to return the name and break the method, returning to the method of the scene. I put a <code>return "missingno";</code> at the end because Studio would give me an error that not all code paths return a value.</p>