Skin Cancer is one of the most widespread forms of cancer in the world which can be detected using dermatoscopic images. In this paper, a texture based feature extraction algorithm is presented for the classification of dermatoscopic images. A median based Local Ternary Pattern is extracted followed by the computation of local quantized ternary patterns. The feature set extracted is then classified using a modified convolutional neural network. The images used for the detection of multiple types of skin cancer are obtained from two publicly available datasets, HAM10000 and ISICUDA11. For the proposed technique, the average recall value, average precision and average accuracy is found to be 75.20%, 95.44% and 96% respectively. An average increase in accuracy for the proposed algorithm is up-to 50.6%, 24.1% and 4.7% over LTP, DLTerQEP and a DE ANN based algorithm respectively.