Advertisement
Guest User

Untitled

a guest
Apr 13th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. //Bank System
  2. #include <stdio.h>
  3. #include <string.h>
  4. #include <stdbool.h>
  5. #include <stdlib.h>
  6.  
  7. #define array_size 4096
  8.  
  9. union register_config {
  10.  
  11. char *username, *password;
  12. };
  13.  
  14. union question { //Question union
  15.  
  16. char *question;
  17. char *response;
  18. } ;
  19.  
  20. bool activated;
  21.  
  22. void registeration()
  23. {
  24. union register_config reg;
  25. int username_size, password_size, age;
  26.  
  27. printf("Enter your username : ");
  28. scanf("%s", reg.username);
  29.  
  30. printf("Enter your password : ");
  31. scanf("%s", reg.password);
  32.  
  33. printf("Enter your age : ");
  34. scanf("%d", &age);
  35.  
  36. username_size = strlen(reg.username); //Checking!
  37. password_size = strlen(reg.password);
  38.  
  39. if(username_size < 8)
  40. {
  41. printf("The username must be atleast 8 character!\n");
  42.  
  43. activated = false;
  44. }
  45.  
  46. else if(password_size < 8)
  47. {
  48. printf("The password must be atleast 8 character\n");
  49.  
  50. activated = false;
  51. }
  52.  
  53. else
  54. {
  55. printf("Registration completed!\n");
  56.  
  57. activated = true;
  58. }
  59.  
  60. printf("For more security please make a question and reponse for it !\n");
  61.  
  62. union question security;
  63.  
  64. printf("Enter the question : ");
  65. gets(security.question);
  66.  
  67. printf("Enter the answer : ");
  68. gets(security.response);
  69.  
  70. }
  71.  
  72. #define EXIT_SUCCESS 0
  73.  
  74. int main()
  75. {
  76. registeration();
  77.  
  78. return EXIT_SUCCESS;
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement