Challenge 1 (Needs improvement and fixing)

Here is the code i wrote for the challenge 1 but there's some bugs i've seen. Please help me to fix them.First of all, when i write a password that has more than 20 characters, the programs crashes. I tried some ways, but i couldn't fix it. Secondly when i write only numbers as a password, it checks the condition of having a capital letter and it prints "Capital test : 1 Passed". I don't understand why it does that. Please help me to fix the bugs and if you have any advices to improve the program, please tell me. Thank you.

One of the biggest problem in your code is at the beggining, "the header parts" Turns out you've written just #include for the libraries that you wanted to use but which libraries you want'em to be? Check it out a few times again, then it'll be much easier to make it feasible somehow

the reason your program crashes is because of a segmentation fault where you are writing/reading invalid memory.when you have a buffer of 20 characters, you only have 20 spaces to hold your input from scanf(). once you have breached the 20 limit, you start to write into other variables, i.e. check, capital, number and sign as i have boxed in red in the first image. because of this, your values will then remain the same throughout the rest of the program and when you come to test these values, they will pass your if statements. on the second image, i have inputted a much longer string and as you can see "invalid read size of 4", it means that you are trying to access memory outside of your program stacks - 4 probably because it is size of int.