Advertisement
Guest User

project

a guest
Jul 16th, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.92 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3. #include<conio.h>
  4. #include<stdlib.h>
  5. #define ENTER 13
  6. void login();
  7. void menu();
  8. int main()
  9. {
  10.     login();
  11.     return 0;
  12. }
  13. void login()
  14. {
  15.     int i;
  16.     char password[100],ch;
  17.     char username[100];
  18.     printf("\n\n\t\t*************************************************\n\t\t*\t\t\t\t\t\t*\n\t\t*\tENTER YOUR USERNAME AND PASSWORD\t*\n\t\t*\t\t\t\t\t\t*\n\t\t*************************************************\n");
  19.     printf("\n\t\t\tUSERNAME:");
  20.     scanf("%s",&username);
  21.     printf("\n\t\t\tPASSWORD:");
  22.  
  23.     for(i=0; i<100; i++)
  24.  
  25.     {
  26.         ch = getch();
  27.         if(ch==ENTER)
  28.         {
  29.            break;
  30.         }
  31.  
  32.         else {
  33.             password[i] = ch;
  34.         ch = '*' ;
  35.         printf("%c",ch);
  36.         }
  37.  
  38.     }
  39.  
  40.     password[i] = '\0';
  41.     if(strcmp(username,"abc")==0)
  42.     {
  43.  
  44.  
  45.         if(strcmp(password,"123")==0)
  46.         { getch();
  47.         system("CLS");
  48.             printf("\n\n\t\tSUCCESSFULLY LOG IN......");
  49.              printf("\n\n\t\tPress Any Key To Countinue..... ");
  50.              getch();
  51.         system("CLS");
  52.               menu();
  53.         }
  54.         else
  55.         {
  56.             printf("\n\n\t\tPlease Enter Correct Password.....");
  57.             printf("\n\n\t\tPress Any Key To Countinue..... ");
  58.             getch();
  59.         system("CLS");
  60.          login();
  61.         }
  62.  
  63.  
  64.     }
  65.     else
  66.     {
  67.         printf("\n\n\t\tPlease Enter Correct Username.....");
  68.         printf("\n\n\t\tPress Any Key To Countinue..... ");
  69.         getch();
  70.         system("CLS");
  71.         login();
  72.     }
  73.  
  74.  
  75.  
  76.  
  77. }
  78.  
  79. void menu()
  80. {
  81.     int choise,quite;
  82.     printf("\n\n\t\t   ======WELCOME TO BLOOD GROUP MANAGEMENT======\n");
  83.     printf("\n\n\t\t\t*********************************\n\t\t\t*\t\t\t\t*\n\t\t\t*\t     Main Menu      \t*\n\t\t\t*\t\t\t\t*\n\t\t\t*********************************\n\t\t\t*\t\t\t\t*");
  84.     printf("\n\t\t\t*\t  [1]Data Entry\t\t*\n");
  85.     printf("\t\t\t*\t  [2]Search\t\t*\n");
  86.     printf("\t\t\t*\t  [3]Delete\t\t*\n");
  87.     printf("\t\t\t*\t  [4]About\t\t*\n");
  88.     printf("\t\t\t*\t  [5]Exit\t\t*\n");
  89.     printf("\t\t\t*\t  [1]Data Entry\t\t*\n\t\t\t*\t\t\t\t*\n");
  90.     printf("\t\t\t*********************************\n\n");
  91.     printf("\t\t\t\tChoise Any Number: ");
  92.  
  93.     scanf("%d",&choise);
  94.     system("CLS");
  95.     switch(choise)
  96.     {
  97.     case 5:
  98.         printf("\n\n\n\t\t\t*********************************\n\t\t\t*\t   Are you sure?\t*\n\t\t\t*********************************\n\t\t\t*\t[1]YES   *\t[2]NO   *\n\t\t\t*********************************");
  99.         printf("\n\n\t\t\tChoise Any Number: ");
  100.         scanf("%d",&quite);
  101.         if(quite==1)
  102.         {
  103.         system("CLS");
  104.         printf("\n\n\n\n\n\n\t\t\t*********Thanks For Using*********\n\n\n\n\n\n\n\n\n\n\n");
  105.             break;
  106.         }
  107.         else
  108.         {
  109.  
  110.         system("CLS");
  111.             menu();
  112.         }
  113.  
  114.     }
  115. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement