Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream.h>
- #include<conio.h>
- #include<stdio.h>
- #include<string.h>
- void main()
- {
- clrscr();
- char password[10],*c=NULL,*b=NULL;
- int flag,f;
- cout<<"Enter the password";
- c=password;
- b=password;
- cin>>c;
- for(;c!='\0';c++)
- {
- if((*(c)>='A')&&(*(c)<='Z'))
- flag=0;
- else if(*c=='\0')
- break;
- else
- {flag=1;
- break;}
- }
- if(flag==0)
- {
- while(*b)
- {
- if(*(b)==*(b+1))
- {cout<<"Rejected";
- break;}
- else if((*(b)==*(b+2))&&*(b+1)==*(b+3))
- {cout<<"Rejected";
- break;}
- else if(*b=='\0')
- break;
- else
- f=0;
- b++;
- }
- if(f==0)
- cout<<"Accepted";
- }
- else
- cout<<"Password is not in uppercase";
- getch();
- }
Add Comment
Please, Sign In to add comment