do{ printf("\nEnter your password. \n\nUse capital letter, a number and a special sign for good strength of password. \nUse 8 characters for password, precisely. \n\n"); scanf(" %s", password);}while(strlen(password)!=8); // do this as long as the number of entered characters is not 8! while(strlen(password)!=8);//strlen() defines a length of entered string (number of characters)

Thank you for the feedback c student. You are correct about the formatting of the for loop. It should stop at 19 and not 21 because there is nothing after 19. I will give it a try and let you know how it works.