Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- //char password[15] = "L3tM3in";
- //char username[15] = "Admin19";
- void login();
- void menu(int option);
- int main(int argc, char const *argv[])
- {
- login();
- int option;
- //while(option != 4){
- printf(" Drug Admin. System\n");
- printf("Menu:\n 1. Check Quantity\n 2.Refill\n 3.Dispense\n 4.Quit\n\nSelect Option:\n");
- scanf("Enter int %d", &option);
- menu(option);
- //}
- return 0;
- }
- void menu(int option){
- if(option == 1){
- }
- }
- void login(){
- char username[15] = "test";
- char password[15] = "test";
- char username1;
- char password1;
- int nameCorrect = 1;
- int passCorrect = 1;
- int i = 0;
- int size = 4;
- do {
- i = 0;
- printf("Enter username:");
- username1 = getchar();
- while(username1 != '\n'){
- if(username[i] != username1){
- nameCorrect = 0;
- printf("no");
- }
- i++;
- username1 = getchar();
- }
- i = 0;
- printf("Enter Password:");
- password1 = getchar();
- while(password1 !='\n'){
- if(password[i] != password1){
- printf("no");
- passCorrect = 0;
- }
- i++;
- password1 = getchar();
- }
- system("@cls||clear");
- nameCorrect = 1;
- passCorrect = 1;
- }
- while(((nameCorrect != 1) || (passCorrect != 1)) || i != size);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement