Advertisement
Guest User

Untitled

a guest
Jan 19th, 2020
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main()
  5. {
  6.  
  7. char a[100];
  8. int i = 0;
  9. char copy[100];
  10. int len1 = 0;
  11. int isnumber = 0;
  12. int iscapital = 0;
  13. int isletter = 0;
  14. int inr = 0; // stands for is not reapiting
  15. int j = 0;
  16. printf("Enter your number\n");
  17. gets(a);
  18. strcpy(copy , a);
  19. len1 = strlen(copy);
  20. if(len1>=6&&len1<=8)
  21. {
  22. for(i = 0; i<=copy; i++)
  23. {
  24. if(copy[i]>=48 && copy[i]<=57)
  25. {
  26. isnumber = 1;
  27. }
  28. if(copy[i]>=1 && copy[i]<=26)
  29. {
  30. iscapital = 1;
  31. }
  32. if(copy[i]>=97 && copy[i]<=122)
  33. {
  34. isletter = 1;
  35.  
  36. }
  37.  
  38. }
  39.  
  40.  
  41. }
  42.  
  43. else
  44. {
  45. printf("your password is invalid\n");
  46. }
  47.  
  48.  
  49. for(j = 0; j<=len1-2; j++)
  50. {
  51. if(copy[j]==copy[j+1])
  52. {
  53. inr = 1;
  54. }
  55.  
  56. }
  57.  
  58. if(isletter==1 && isnumber==1 && iscapital==1 && inr==1)
  59. {
  60. printf("your password is great\n");
  61. }
  62. else
  63. {
  64. printf("your password is invalid");
  65. }
  66.  
  67. return(0);
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement