In this paper, we present an Intelligent Tutoring System (ITS), for use in teaching the logic of computer programming and the programming language 'C'. The aim of the ITS is to adapt the delivered learning material and the lesson sequence to the knowledge level and learning needs of each individual student. The adaptation of the presented ITS is based on fuzzy logic and a machine learning technique. Particularly, the system uses the distance weighted k-nearest neighbor algorithm to detect the learner's knowledge level and abilities concerning computer programming during her/ his first interaction with the system. Next and during subsequent interactions of the learner with the system, fuzzy logic is used to identify the learner's current knowledge level and potential misconceptions. The system takes into consideration the knowledge dependencies that exist among the domain concepts of the learning material and, applying fuzzy rules, decides about the learning material that has to be delivered to the learner as well as the lesson sequence. The system has been fully implemented and evaluated through t-tests. The evaluation results show that the combination of machine learning (for initially identifying the student's learning abilities and needs) with fuzzy logic (for the continuous identification of the learner's current knowledge level and misconceptions) provides more personalized learning experience, promotes the active participation of students in the learning process and results in decrease in the number of dropouts. [ABSTRACT FROM AUTHOR]