Spread Gameobjects on Terrain

is it possible to write a code that spreads a number (for example 5) of a gameobject (for example the enemy) within a specific room on the terrain when pressing play? the gameobjects should be spread by coincidence and therefore on different places everytime i press play.
thank you!!

Unity - Scripting API: Object.Instantiate

Should get started with this:

var prefab : Transform;

for (var i : int = 0;i < 5; i++) {
    Instantiate (prefab, Vector3(Random.value, Random.value, Random.value), Quaternion.identity);
}

the code works perfectly, thank you so much!! my problem now is, that the instantiated object is a navmeshagent and it will be placed on non-navmesh-places as well. is there a solution to avoid this?
thanks!

the code works perfectly, thank you so much!! but my problem is now, that the object is a navmeshagent and it will put the instantiated object on non-navmesh-places as well. what can i do about that?
thanks!