Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- char password[100];
- int i;
- printf("Please input a password, it must meet the requirements of \n");
- printf("1. Contain at least one $ character \n");
- printf("2. Contain at least one number \n");
- printf("3. Contain at least one uppercase letter \n");
- printf("4. Contain at least one lower case letter \n");
- scanf ("%c", &password);
- for(i=0;i<=100;i++){
- /*Checks all the above values for i for having a corresponding character in the string that is == to $
- Problem: Each time it is run, even with a '$' included in the password, what the if function is testing for never comes out true
- It will always go to the next if statement that is outside of the for loop*/
- if(password[i]=='$'){
- break;
- }
- }
- if(i=100){
- printf("Your password does not contain a '$'");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement