Create a program in C Language that checks if a password and the repeated confirmation password match according to the following criteria: The password must be at least 8 characters long. The password and confirmed password must match. The password must include at least 1 lowercase character. The password must include at least 1 uppercase character. The password must include at least 1 number. The password must include 1 of the following special characters: ! @ # $ ? In your code, create a function which accepts two character arrays representing the password and repeated password. If the password entered does not meet the requirements listed above, the function should return 1. If the password meets all the requirements, return 0. In main, print a statement indicating the result after the password checking function is called. Save your code as password_check.c Other Requirements Your code must use consistent formatting and spacing. Points will be taken off for inconsistent or sloppy code. Make sure you remove the trailing newline if reading the string using `fgets()`. Example Runs **** Success Enter a password: turkeY1! Enter the password again: turkeY1! Password accepted. **** Failure Enter a password: turkeY11 Enter the password again: turkeY11 Invalid password.
Create a program in C Language that checks if a password and the repeated confirmation password match according to the following criteria:
- The password must be at least 8 characters long.
- The password and confirmed password must match.
- The password must include at least 1 lowercase character.
- The password must include at least 1 uppercase character.
- The password must include at least 1 number.
- The password must include 1 of the following special characters: ! @ # $ ?
In your code, create a function which accepts two character arrays representing the password and repeated password. If the password entered does not meet the requirements listed above, the function should return 1. If the password meets all the requirements, return 0. In main, print a statement indicating the result after the password checking function is called.
Save your code as password_check.c
Other Requirements
- Your code must use consistent formatting and spacing. Points will be taken off for inconsistent or sloppy code.
- Make sure you remove the trailing newline if reading the string using `fgets()`.
Example Runs
**** Success
Enter a password: turkeY1!
Enter the password again: turkeY1!
Password accepted.
**** Failure
Enter a password: turkeY11
Enter the password again: turkeY11
Invalid password.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images