Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- int check(void) {
- char correct[8]="arc";
- char input[8];
- int ok=0;
- printf("password: ");
- gets(input);
- if(strcmp(input,correct)==0) {
- ok=1;
- }
- return ok;
- }
- int main(void) {
- int a=check();
- if(a) printf("Access granted\n");
- else printf("Access denied\n");
- return a?0:1;
- }
Advertisement
Add Comment
Please, Sign In to add comment