Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- void main ()
- {
- char pswrd[20];
- char rep[2];
- char *resp = "y";
- int a = 0;
- again:
- printf("Enter your password:\n");
- scanf("%s", &pswrd);
- printf("%s\n", pswrd);
- if (strcmp(pswrd,"bscs1b") == 0)
- {
- printf("Access granted\n\n");
- }
- else
- {
- printf("Try again? (y/n)\n");
- scanf("%s", &rep);
- if (strcmp(rep, resp) == 0)
- {
- a++;
- if (a < 4)
- {
- goto again;
- }
- else
- {
- printf("You can't try again...\n");
- }
- }
- else
- {
- printf("Bye...\n");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement