Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Bank System
- #include <stdio.h>
- #include <string.h>
- #include <stdbool.h>
- #include <stdlib.h>
- #define array_size 4096
- union register_config {
- char *username, *password;
- };
- union question { //Question union
- char *question;
- char *response;
- } ;
- bool activated;
- void registeration()
- {
- union register_config reg;
- int username_size, password_size, age;
- printf("Enter your username : ");
- scanf("%s", reg.username);
- printf("Enter your password : ");
- scanf("%s", reg.password);
- printf("Enter your age : ");
- scanf("%d", &age);
- username_size = strlen(reg.username); //Checking!
- password_size = strlen(reg.password);
- if(username_size < 8)
- {
- printf("The username must be atleast 8 character!\n");
- activated = false;
- }
- else if(password_size < 8)
- {
- printf("The password must be atleast 8 character\n");
- activated = false;
- }
- else
- {
- printf("Registration completed!\n");
- activated = true;
- }
- printf("For more security please make a question and reponse for it !\n");
- union question security;
- printf("Enter the question : ");
- gets(security.question);
- printf("Enter the answer : ");
- gets(security.response);
- }
- #define EXIT_SUCCESS 0
- int main()
- {
- registeration();
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement