#include <iostream> #include <stdio.h> #include <stdlib.h> int IsValidMobile(char* number) { int flag = 0; if (strlen(number) != 13) flag = 1; else { for (int i = 0; i < 13; i++) { if (number[i]<'0' && number[i]>'9') flag = 2; break; } if (flag != 2 && (number[0] != 8 || number[1] != 6 || number[2] != 1)) flag = 3; else flag = 0; } return flag; }