+ 1

What is the the 7th test i passed all except 7th in password validation

Password validation https://code.sololearn.com/cSRc1au1894B/?ref=app

3rd Feb 2020, 11:34 AM
Samarendra Singh
Samarendra Singh - avatar
9 odpowiedzi
+ 3
#include <stdio.h> main() { char s[100]; scanf("%s",&s); int i,length ,numbers=0, special_characters=0; length=strlen(s); for(i=0;i<length;i++){ if(s[i]>='0'&&s[i]<='9'){ numbers++; } else if(s[i]=='!'||s[i]=='@'||s[i]=='#'||s[i]=='
#x27;||s[i]=='%'||s[i]=='&'||s[i]=='*'){ special_characters++; } } if(length>=7 && special_characters>=2 && numbers>=2){ printf("Strong"); } else { printf("Weak"); } } You can try this one.. .
2nd May 2020, 6:38 AM
View My Project
View My Project - avatar
+ 1
Thanks i should remember that i comparing char array to number.
3rd Feb 2020, 12:03 PM
Samarendra Singh
Samarendra Singh - avatar
+ 1
🕸️PronaY Sarker™🕸️ thanks Logic for checking no. Is pretty goods I should thinks about this.
2nd May 2020, 9:10 AM
Samarendra Singh
Samarendra Singh - avatar
0
~ swim ~ i try with if(pass[i]==1||pass[i]==2||pass[i]==4....) But again it show error
3rd Feb 2020, 11:56 AM
Samarendra Singh
Samarendra Singh - avatar
0
And 8 know that is wrong way but not getting the right way so i go through that..
3rd Feb 2020, 11:57 AM
Samarendra Singh
Samarendra Singh - avatar
0
I try with if (pass[i]==0) Num++; Else if (pass[i]==1) Num++; ... ... Else if(pass[i]==9) Num++; It also shows error ..
3rd Feb 2020, 12:01 PM
Samarendra Singh
Samarendra Singh - avatar