Guest User

Untitled

a guest
Apr 18th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. int main()
  2. {
  3. char username[10];
  4. char user[10];
  5. char password[10];
  6. char pass[10];
  7. char time[10];
  8. int times=0;
  9.  
  10. while(times < max_times)
  11. {
  12. printf("nieuwe username:\n");
  13. scanf("%s",username);
  14. printf("nieuwe password:\n");
  15. scanf("%s",password);
  16. printf("username:\n");
  17. scanf("%s",user);
  18. printf("password:\n");
  19. scanf("%s",pass);
  20. //printf("%s %s %s %s\n",username,user,password,pass); <-- controleert of de waarden goed worden opgenomen door scanf
  21. if(strcmp(username,user)==0)
  22. {
  23. printf("correct\n");
  24. end=1;
  25. }
  26. else if(strcmp(username,user)!=0)
  27. {
  28. printf("fout\n");
  29. times=times+1;
  30. printf("Dit is maal %i dat u verkeerde gegevens ingeeft, na de 3de keer moet u het programma herstarten!\n",times);
  31. }
  32. else /*dit moet niet kunnen gebeuren*/
  33. {
  34. printf("Shit\n");
  35. }
  36. }
  37. return(0);
  38. }
Add Comment
Please, Sign In to add comment