Password validation | Sololearn: Learn to code for FREE!

+6

Password validation

Help me please! What is wrong with my code always says test case 13 failed in code coach section when trying to submit my code ?? https://code.sololearn.com/c487rcNdn7Kd/?ref=app

8/16/2020 9:45:23 AM

Ahmed Mahmoud

5 Answers

New Answer

+3

include <stdio.h> "if" clause guarding warning, it happens when you write like this while(arr[i]) { if(....) do_something i++; <== this will generate warning. if block has a single line as body but on first look it appears i is incremented inside if statement body fix write i++, aligned with if if(...) do_something i++; or use braces ("{}") with if even when the body has single statement gets() warning, this function has been removed/deprecated from C/C++(removed from C++ not sure of C) use fgets function instead. For github, it's totally your choice, if you feel like uploading then go ahead.

+5

really really thank u very much 🌺❤️❤️ it passed 🔥

+5

thanks a lot 🌺🌺

+3

~ swim ~ one more question please ? have a look again at my code after l have fixed it and tell me please how can i remove these warning messages ? and if thers is any comment on the over all code ? and one last question is it valuable to upload it to Github ?

+2

No need to check for space. Passwords do not have spaces beside problem statement does not mention it. Logic error everywhere while(arr[i++] != '\0') { } i++ will skip the current character. increment i inside the loop body