In today's world, technological trends facilitate faster and easier communication between people any where in the world. Data search and exchange is one mouse click away from every people and this causes an exponential increase in the magnitude of plagiarism. Researches show that this is a serious problem in many academic institutions and research institutes. In this paper, we have developed an algorithm based on fingerprinting approach to identify the reuse of source codes in direct and indirect way. The results show that the proposed method is efficient in computation and resources and, provides effective measures to detect plagiarized programs. Effectiveness of the features used in the proposed methods is tested using a large database, including programs of different programming languages.