Advertisement
Guest User

Untitled

a guest
May 26th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <sys/types.h>
  4.  
  5. char initChoice;
  6.  
  7. char username;
  8. char password;
  9. char usery0;
  10. char passy0;
  11.  
  12. void Login();
  13. void Register();
  14.  
  15. int main()
  16. {
  17. system("title XeClutch - Simple Login System");
  18. system("color a");
  19. printf("Hello, what would you like to do?\n[A] Login\n[B] Register\n");
  20. scanf("%c", &initChoice);
  21. if(initChoice == 'A' || initChoice == 'a')
  22. {
  23. Login();
  24. }
  25. else if(initChoice == 'B' || initChoice == 'b')
  26. {
  27. Register();
  28. }
  29. else
  30. {
  31. printf("Invalid Operation...");
  32.  
  33. }
  34. return 0;
  35. }
  36.  
  37. void Login()
  38. {
  39. printf("\n\nPlease enter your username: ");
  40. scanf("%s", &usery0);
  41. if(usery0 == username)
  42. {
  43. printf("Please enter your password: ");
  44. scanf("%s", &password);
  45. if(passy0 == password)
  46. {
  47. printf("Successful Login!");
  48.  
  49. }
  50. else
  51. {
  52. printf("Incorrect Password...\n");
  53.  
  54. }
  55. }
  56. else
  57. {
  58. printf("Incorrect Username...\n");
  59.  
  60. }
  61. }
  62.  
  63. void Register()
  64. {
  65. printf("\n\nEnter a new username: ");
  66. scanf("%s", &username);
  67. printf("Enter a new password: ");
  68. scanf("%s", &password);
  69. printf("\nRegistration Successful!\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  70. main();
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement