+ 1
What is the the 7th test i passed all except 7th in password validation
Password validation https://code.sololearn.com/cSRc1au1894B/?ref=app
9 Réponses
+ 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..
.
+ 1
Thanks
i should remember that i comparing char array to number.
+ 1
🕸️PronaY Sarker™🕸️ thanks
Logic for checking no. Is pretty goods
I should thinks about this.
0
~ swim ~ i try with if(pass[i]==1||pass[i]==2||pass[i]==4....)
But again it show error
0
And 8 know that is wrong way but not getting the right way so i go through that..
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 ..