Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- int main()
- {
- char a[100];
- int i = 0;
- char copy[100];
- int len1 = 0;
- int isnumber = 0;
- int iscapital = 0;
- int isletter = 0;
- int inr = 0; // stands for is not reapiting
- int j = 0;
- printf("Enter your number\n");
- gets(a);
- strcpy(copy , a);
- len1 = strlen(copy);
- if(len1>=6&&len1<=8)
- {
- for(i = 0; i<=copy; i++)
- {
- if(copy[i]>=48 && copy[i]<=57)
- {
- isnumber = 1;
- }
- if(copy[i]>=1 && copy[i]<=26)
- {
- iscapital = 1;
- }
- if(copy[i]>=97 && copy[i]<=122)
- {
- isletter = 1;
- }
- }
- }
- else
- {
- printf("your password is invalid\n");
- }
- for(j = 0; j<=len1-2; j++)
- {
- if(copy[j]==copy[j+1])
- {
- inr = 1;
- }
- }
- if(isletter==1 && isnumber==1 && iscapital==1 && inr==1)
- {
- printf("your password is great\n");
- }
- else
- {
- printf("your password is invalid");
- }
- return(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement