We have investigated the mechanisms of determining the stellar mass in the process of star formation. Because the stellar core grows by the inflow of matter from the parent cloud core, the mass of the growing star is fixed when the supply of matter from the cloud core is stopped. Because the cloud core matter falls onto the stellar core mostly through an accretion disk, a significant fraction of the mass outflow from the stellar vicinity and the stellar radiation escapes from the inner region without interacting with the infalling matter. A considerable fraction of the cloud core matter which has not yet contracted much is blown off by the mass outflow and the H II region developed by the stellar ultraviolet radiation. Although some cloud core matter may remain at this stage, it disperses soon because it is no longer gravitationally bound. Consequently, the supply of matter to the accretion disk and then to the stellar core stops. The stellar mass, M*, determined in this way is a function of the density of the cloud core, n(c), the mass inflow rate from the cloud core, M(I), the mass outflow rate relative to the inflow rate, M(0)/M(I), and the cloud core mass relative to the generalized Jeans mass, M(c)/M(J), and it can also be represented as a function of n(c), M(c), M(0)/M(I), and M(c)/M(J). When the mass outflow is dominant in blowing off the cloud core matter, we have M* proportional to M(c)(7/6)n(c)(1/1.2) with the proportionality coefficient dependent on M(0)/M(I), and thus the stellar mass is almost independent of n(c). The star formation efficiency M*/M(c) is therefore mainly determined by M(0)/M(I) and is only weakly dependent on the core parameters M(c) and n(c); for a typical value M(0)/M(I) = 0.1, we obtain M*/M(c) x 0.04 around M(c) similar to 100 M.. Applying this method to the observed cloud cores in the Orion A molecular cloud by assuming that each core does not contain subclumps, we estimate the stellar mass and the initial mass function of stars (IMF) expected in this cloud. As long as M(0)/M(I) > 0.02, the mass outflow is more efficient than the H II region in determining the stellar mass for all the Orion A cores. The IMF at M* greater than or similar to 4 M. can be approximated by a power law dN*/d log M* proportional to M*(-1.7) for M(0)/M(I) = 0.1, which is in reasonable agreement with the IMF of held stars proportional to M*(-1.5), at M* greater than or similar to 3 M.. We also discuss star formation in the cloud core which contains many subclumps.