Password Validator code coach test case #8 not passing. pls help! | SoloLearn: Learn to code for FREE!

+2

Password Validator code coach test case #8 not passing. pls help!

This is my code. Its not passing test case #8. All other 12 test cases it passed without any issue. #include <stdio.h> #include <string.h> int main() { char str[20], num[15] = {'1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '\0'}, schar[8] = {'!', '@', '#', '$', '%', '&', '*', '\0'}; int t, ct1, ct2; scanf("%s", str); t = strlen(str); for(int i=0; i<t; i++) { for(int j=0; j<10; j++) { if (str[i] == num[j]) ct1++; else if (str[i] == schar[j]) ct2++; } } if (t>6 && ct2>1 && ct1>1) printf("Strong"); else printf("Weak"); return 0; }

3/3/2021 11:54:20 AM

Bittu Joshi

2 Answers

New Answer

+1

I don’t know the “strong” password criteria. But I suspect your error is with the line: if(t>6 && .... —- double-check that logic.

+1

Ok. I will check and tell u if it works. Later. Today is my computer programming exam and I need to learn file management in c. Time let: 1 hour. 😭😭