Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int counter;
- int i;
- char password[10];
- counter=0;
- printf("Enter your password (maximum 9 characters): ");
- scanf("%s", password);
- printf("\n");
- for (i=0;i<10;i++){
- if (isalpha(password[i])) {
- if (isupper(password[i])) {
- counter++;
- break;
- }
- }
- }
- for (i=0;i<10;i++){
- if (isalpha(password[i])) {
- if (islower(password[i])) {
- counter++;
- break;
- }
- }
- }
- for (i=0;i<10;i++){
- if (isdigit(password[i])) {
- counter++;
- break;
- }
- }
- if (counter==3){
- printf("Your password is correct.\n");
- }
- else {
- printf("\aYour password is not correct.\n");
- }
- printf("%s", password);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement