Massive multiple input multiple output communication is now possible using millimeter wave frequency band. In this paper a transmit antenna selection algorithm is developed which satisfies a quality of service (QoS) for a given user. In order to achieve a particular level of QoS, the number of transmit antennas required is determined by remodeling it as a Knapsack Problem (KP). The smallest subset of antenna elements is found at the transmitter side to achieve the desired level of QoS using KP. Furthermore, we have compared our algorithm with the sorted and unsorted sequential selection algorithm (SSA). Our algorithm achieves similar performance as compared to SSA but with lower computational complexity than the sorted SSA. Moreover, the energy efficiency of our algorithm is similar to that of the sorted SSA but superior to unsorted SSA, as it is not sensitive to the arrangement of the antenna gains.