Guest User

Untitled

a guest
Aug 10th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #include<iostream.h>
  2. #include<conio.h>
  3. #include<stdio.h>
  4. #include<string.h>
  5. void main()
  6. {
  7. clrscr();
  8. char password[10],*c=NULL,*b=NULL;
  9. int flag,f;
  10. cout<<"Enter the password";
  11. c=password;
  12. b=password;
  13. cin>>c;
  14. for(;c!='\0';c++)
  15. {
  16. if((*(c)>='A')&&(*(c)<='Z'))
  17. flag=0;
  18. else if(*c=='\0')
  19. break;
  20. else
  21. {flag=1;
  22. break;}
  23. }
  24. if(flag==0)
  25. {
  26. while(*b)
  27. {
  28. if(*(b)==*(b+1))
  29. {cout<<"Rejected";
  30. break;}
  31. else if((*(b)==*(b+2))&&*(b+1)==*(b+3))
  32. {cout<<"Rejected";
  33. break;}
  34. else if(*b=='\0')
  35. break;
  36. else
  37. f=0;
  38. b++;
  39. }
  40. if(f==0)
  41. cout<<"Accepted";
  42. }
  43. else
  44. cout<<"Password is not in uppercase";
  45. getch();
  46. }
Add Comment
Please, Sign In to add comment