for(i=0;i<=lenString;i++) { if(string[i] == string[i+1]) { if((password[i] != '\0') && (password[i+1] != '\0')) { countRepeated++; } }