Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. // this simple app is a password console app. It will ask for a password only
  4.  
  5. int main ()
  6.  
  7. {
  8. char user[6] = "admin";
  9. char pass[4] = "abc";
  10.  
  11. printf("What is the username to login in?");
  12. scanf("%s",&user);
  13. printf("What is the password to login in?");
  14. scanf("%s",&pass);
  15.  
  16. if(strcmp(user,"admin")== 1 && strcmp(pass,"abc")==1 ){
  17. printf("You answered the right user and pass, you are now loged in");
  18. }else{
  19. printf("wrong user,password. Please try again");
  20. }
  21.  
  22. getchar();
  23. getchar();
  24.  
  25. return 0;
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement