Question: Password checker You are given a function: int CheckPassword ( char str [ ] , int n ) ; The function accepts string ' str

Password checker
You are given a function:
int CheckPassword(char str[], int n);
The function accepts string 'str' of size 'n' as an argument. Implement the function which returns 1 if given string 'str' is a valid password else 0.'str' is a valid password if it satisfies the below conditions:
-At least 4 characters
-At least one numeric digit
-Atleast one capital letter
-Must not have space or slash (??)
-Starting character must not be a number
Assumption:
The input string will not be empty.
Example
Input
aA1_67
Output
1
Input format
Input is a string given by the user.
Output format
Output can be 1 if the entered string is a valid password or 0 if it is invalid.
Sample testcases
Input 1
aA1_67
Output 1
1
Input 2
A4.
Output 2
0
 Password checker You are given a function: int CheckPassword(char str[], int

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!