Advertisement
Radoan_Ahmed

Untitled

Dec 5th, 2019
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 20.37 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. #include<windows.h>
  4. int i,j;
  5. int main_exit;
  6. void menu();
  7. struct date{
  8.     int month,day,year;
  9.  
  10.     };
  11. struct {
  12.  
  13.     char name[60];
  14.     int acc_no,age;
  15.     char address[60];
  16.     char citizenship[15];
  17.     double phone;
  18.     char acc_type[10];
  19.     float amt;
  20.     struct date dob;
  21.     struct date deposit;
  22.     struct date withdraw;
  23.  
  24.     }add,upd,check,rem,transaction;
  25.  
  26. float interest(float t,float amount,int rate)
  27. {
  28.     float SI;
  29.     SI=(rate*t*amount)/100.0;
  30.     return (SI);
  31.  
  32. }
  33. void fordelay(int j)
  34. {   int i,k;
  35.     for(i=0;i<j;i++)
  36.          k=i;
  37. }
  38.  
  39. void new_acc()
  40.  
  41. {
  42.     int choice;
  43.     FILE *ptr;
  44.  
  45.     ptr=fopen("record.dat","a+");
  46.     account_no:
  47.     system("cls");
  48.     printf("\t\t\t\xB2\xB2\xB2\ ADD RECORD  \xB2\xB2\xB2\xB2");
  49.     printf("\n\n\nEnter today's date(mm/dd/yyyy):");
  50.     scanf("%d/%d/%d",&add.deposit.month,&add.deposit.day,&add.deposit.year);
  51.     printf("\nEnter the account number:");
  52.     scanf("%d",&check.acc_no);
  53.     while(fscanf(ptr,"%d %s %d/%d/%d %d %s %s %lf %s %f %d/%d/%d\n",&add.acc_no,add.name,&add.dob.month,&add.dob.day,&add.dob.year,&add.age,add.address,add.citizenship,&add.phone,add.acc_type,&add.amt,&add.deposit.month,&add.deposit.day,&add.deposit.year)!=EOF)(
  54.     {
  55.         if (check.acc_no==add.acc_no)
  56.             {printf("Account no. already in use!");
  57.             fordelay(1000000000);
  58.                 goto account_no;
  59.  
  60.             }
  61.     }
  62.     add.acc_no=check.acc_no;
  63.         printf("\nEnter the name:");
  64.     scanf("%s",add.name);
  65.     printf("\nEnter the date of birth(mm/dd/yyyy):");
  66.     scanf("%d/%d/%d",&add.dob.month,&add.dob.day,&add.dob.year);
  67.     printf("\nEnter the age:");
  68.     scanf("%d",&add.age);
  69.     printf("\nEnter the address:");
  70.     scanf("%s",add.address);
  71.     printf("\nEnter the citizenship number:");
  72.     scanf("%s",add.citizenship);
  73.     printf("\nEnter the phone number: ");
  74.     scanf("%lf",&add.phone);
  75.     printf("\nEnter the amount to deposit:$");
  76.     scanf("%f",&add.amt);
  77.     printf("\nType of account:\n\t#Saving\n\t#Current\n\t#Fixed1(for 1 year)\n\t#Fixed2(for 2 years)\n\t#Fixed3(for 3 years)\n\n\tEnter your choice:");
  78.     scanf("%s",add.acc_type);
  79.  
  80.         fprintf(ptr,"%d %s %d/%d/%d %d %s %s %lf %s %f %d/%d/%d\n",add.acc_no,add.name,add.dob.month,add.dob.day,add.dob.year,add.age,add.address,add.citizenship,add.phone,add.acc_type,add.amt,add.deposit.month,add.deposit.day,add.deposit.year);
  81.  
  82.  
  83.     fclose(ptr);
  84.     printf("\nAccount created successfully!");
  85.     add_invalid:
  86.     printf("\n\n\n\t\tEnter 1 to go to the main menu and 0 to exit:");
  87.     scanf("%d",&main_exit);
  88.     system("cls");
  89.     if (main_exit==1)
  90.         menu();
  91.     else if(main_exit==0)
  92.             close();
  93.     else
  94.         {
  95.             printf("\nInvalid!\a");
  96.             goto add_invalid;
  97.         }
  98. }
  99. void view_list()
  100. {
  101.     FILE *view;
  102.     view=fopen("record.dat","r");
  103.     int test=0;
  104.     system("cls");
  105.     printf("\nACC. NO.\tNAME\t\t\tADDRESS\t\t\tPHONE\n");
  106.  
  107.     while(fscanf(view,"%d %s %d/%d/%d %d %s %s %lf %s %f %d/%d/%d",&add.acc_no,add.name,&add.dob.month,&add.dob.day,&add.dob.year,&add.age,add.address,add.citizenship,&add.phone,add.acc_type,&add.amt,&add.deposit.month,&add.deposit.day,&add.deposit.year)!=EOF)
  108.        {
  109.            printf("\n%6d\t %10s\t\t\t%10s\t\t%.0lf",add.acc_no,add.name,add.address,add.phone);
  110.            test++;
  111.        }
  112.  
  113.     fclose(view);
  114.     if (test==0)
  115.         {   system("cls");
  116.             printf("\nNO RECORDS!!\n");}
  117.  
  118.     view_list_invalid:
  119.      printf("\n\nEnter 1 to go to the main menu and 0 to exit:");
  120.         scanf("%d",&main_exit);
  121.         system("cls");
  122.         if (main_exit==1)
  123.             menu();
  124.         else if(main_exit==0)
  125.             close();
  126.         else
  127.         {
  128.             printf("\nInvalid!\a");
  129.             goto view_list_invalid;
  130.         }
  131. }
  132. void edit(void)
  133. {
  134.     int choice,test=0;
  135.     FILE *old,*newrec;
  136.     old=fopen("record.dat","r");
  137.     newrec=fopen("new.dat","w");
  138.  
  139.     printf("\nEnter the account no. of the customer whose info you want to change:");
  140.     scanf("%d",&upd.acc_no);
  141.     while(fscanf(old,"%d %s %d/%d/%d %d %s %s %lf %s %f %d/%d/%d",&add.acc_no,add.name,&add.dob.month,&add.dob.day,&add.dob.year,&add.age,add.address,add.citizenship,&add.phone,add.acc_type,&add.amt,&add.deposit.month,&add.deposit.day,&add.deposit.year)!=EOF)
  142.     {
  143.         if (add.acc_no==upd.acc_no)
  144.         {   test=1;
  145.             printf("\nWhich information do you want to change?\n1.Address\n2.Phone\n\nEnter your choice(1 for address and 2 for phone):");
  146.             scanf("%d",&choice);
  147.             system("cls");
  148.             if(choice==1)
  149.                 {printf("Enter the new address:");
  150.                 scanf("%s",upd.address);
  151.                 fprintf(newrec,"%d %s %d/%d/%d %d %s %s %lf %s %f %d/%d/%d\n",add.acc_no,add.name,add.dob.month,add.dob.day,add.dob.year,add.age,upd.address,add.citizenship,add.phone,add.acc_type,add.amt,add.deposit.month,add.deposit.day,add.deposit.year);
  152.                 system("cls");
  153.                 printf("Changes saved!");
  154.                 }
  155.             else if(choice==2)
  156.                 {
  157.                     printf("Enter the new phone number:");
  158.                 scanf("%lf",&upd.phone);
  159.                 fprintf(newrec,"%d %s %d/%d/%d %d %s %s %lf %s %f %d/%d/%d\n",add.acc_no,add.name,add.dob.month,add.dob.day,add.dob.year,add.age,add.address,add.citizenship,upd.phone,add.acc_type,add.amt,add.deposit.month,add.deposit.day,add.deposit.year);
  160.                 system("cls");
  161.                 printf("Changes saved!");
  162.                 }
  163.  
  164.         }
  165.         else
  166.             fprintf(newrec,"%d %s %d/%d/%d %d %s %s %lf %s %f %d/%d/%d\n",add.acc_no,add.name,add.dob.month,add.dob.day,add.dob.year,add.age,add.address,add.citizenship,add.phone,add.acc_type,add.amt,add.deposit.month,add.deposit.day,add.deposit.year);
  167.     }
  168.     fclose(old);
  169.     fclose(newrec);
  170.     remove("record.dat");
  171.     rename("new.dat","record.dat");
  172.  
  173. if(test!=1)
  174.         {   system("cls");
  175.             printf("\nRecord not found!!\a\a\a");
  176.             edit_invalid:
  177.               printf("\nEnter 0 to try again,1 to return to main menu and 2 to exit:");
  178.               scanf("%d",&main_exit);
  179.               system("cls");
  180.                  if (main_exit==1)
  181.  
  182.                     menu();
  183.                 else if (main_exit==2)
  184.                     close();
  185.                 else if(main_exit==0)
  186.                     edit();
  187.                 else
  188.                     {printf("\nInvalid!\a");
  189.                     goto edit_invalid;}
  190.         }
  191.     else
  192.         {printf("\n\n\nEnter 1 to go to the main menu and 0 to exit:");
  193.         scanf("%d",&main_exit);
  194.         system("cls");
  195.         if (main_exit==1)
  196.             menu();
  197.         else
  198.             close();
  199.         }
  200. }
  201.  
  202. void transact(void)
  203. {   int choice,test=0;
  204.     FILE *old,*newrec;
  205.     old=fopen("record.dat","r");
  206.     newrec=fopen("new.dat","w");
  207.  
  208.         printf("Enter the account no. of the customer:");
  209.     scanf("%d",&transaction.acc_no);
  210.     while (fscanf(old,"%d %s %d/%d/%d %d %s %s %lf %s %f %d/%d/%d",&add.acc_no,add.name,&add.dob.month,&add.dob.day,&add.dob.year,&add.age,add.address,add.citizenship,&add.phone,add.acc_type,&add.amt,&add.deposit.month,&add.deposit.day,&add.deposit.year)!=EOF)
  211.    {
  212.  
  213.             if(add.acc_no==transaction.acc_no)
  214.             {   test=1;
  215.                 if(strcmpi(add.acc_type,"fixed1")==0||strcmpi(add.acc_type,"fixed2")==0||strcmpi(add.acc_type,"fixed3")==0)
  216.                 {
  217.                     printf("\a\a\a\n\nYOU CANNOT DEPOSIT OR WITHDRAW CASH IN FIXED ACCOUNTS!!!!!");
  218.                     fordelay(1000000000);
  219.                     system("cls");
  220.                     menu();
  221.  
  222.                 }
  223.                 printf("\n\nDo you want to\n1.Deposit\n2.Withdraw?\n\nEnter your choice(1 for deposit and 2 for withdraw):");
  224.                 scanf("%d",&choice);
  225.                 if (choice==1)
  226.                 {
  227.                     printf("Enter the amount you want to deposit:$ ");
  228.                     scanf("%f",&transaction.amt);
  229.                     add.amt+=transaction.amt;
  230.                     fprintf(newrec,"%d %s %d/%d/%d %d %s %s %lf %s %f %d/%d/%d\n",add.acc_no,add.name,add.dob.month,add.dob.day,add.dob.year,add.age,add.address,add.citizenship,add.phone,add.acc_type,add.amt,add.deposit.month,add.deposit.day,add.deposit.year);
  231.                     printf("\n\nDeposited successfully!");
  232.                 }
  233.                 else
  234.                 {
  235.                     printf("Enter the amount you want to withdraw:$ ");
  236.                     scanf("%f",&transaction.amt);
  237.                     add.amt-=transaction.amt;
  238.                     fprintf(newrec,"%d %s %d/%d/%d %d %s %s %lf %s %f %d/%d/%d\n",add.acc_no,add.name,add.dob.month,add.dob.day,add.dob.year,add.age,add.address,add.citizenship,add.phone,add.acc_type,add.amt,add.deposit.month,add.deposit.day,add.deposit.year);
  239.                     printf("\n\nWithdrawn successfully!");
  240.                 }
  241.  
  242.             }
  243.             else
  244.             {
  245.                fprintf(newrec,"%d %s %d/%d/%d %d %s %s %lf %s %f %d/%d/%d\n",add.acc_no,add.name,add.dob.month,add.dob.day,add.dob.year,add.age,add.address,add.citizenship,add.phone,add.acc_type,add.amt,add.deposit.month,add.deposit.day,add.deposit.year);
  246.             }
  247.    }
  248.    fclose(old);
  249.    fclose(newrec);
  250.    remove("record.dat");
  251.    rename("new.dat","record.dat");
  252.    if(test!=1)
  253.    {
  254.        printf("\n\nRecord not found!!");
  255.        transact_invalid:
  256.       printf("\n\n\nEnter 0 to try again,1 to return to main menu and 2 to exit:");
  257.       scanf("%d",&main_exit);
  258.       system("cls");
  259.       if (main_exit==0)
  260.         transact();
  261.     else if (main_exit==1)
  262.         menu();
  263.     else if (main_exit==2)
  264.         close();
  265.     else
  266.     {
  267.         printf("\nInvalid!");
  268.         goto transact_invalid;
  269.     }
  270.  
  271.    }
  272.    else
  273.    {
  274.        printf("\nEnter 1 to go to the main menu and 0 to exit:");
  275.         scanf("%d",&main_exit);
  276.         system("cls");
  277.         if (main_exit==1)
  278.             menu();
  279.         else
  280.             close();
  281.    }
  282.  
  283. }
  284. void erase(void)
  285. {
  286.     FILE *old,*newrec;
  287.     int test=0;
  288.     old=fopen("record.dat","r");
  289.     newrec=fopen("new.dat","w");
  290.     printf("Enter the account no. of the customer you want to delete:");
  291.     scanf("%d",&rem.acc_no);
  292.     while (fscanf(old,"%d %s %d/%d/%d %d %s %s %lf %s %f %d/%d/%d",&add.acc_no,add.name,&add.dob.month,&add.dob.day,&add.dob.year,&add.age,add.address,add.citizenship,&add.phone,add.acc_type,&add.amt,&add.deposit.month,&add.deposit.day,&add.deposit.year)!=EOF)
  293.    {
  294.         if(add.acc_no!=rem.acc_no)
  295.             fprintf(newrec,"%d %s %d/%d/%d %d %s %s %lf %s %f %d/%d/%d\n",add.acc_no,add.name,add.dob.month,add.dob.day,add.dob.year,add.age,add.address,add.citizenship,add.phone,add.acc_type,add.amt,add.deposit.month,add.deposit.day,add.deposit.year);
  296.  
  297.         else
  298.             {test++;
  299.             printf("\nRecord deleted successfully!\n");
  300.             }
  301.    }
  302.    fclose(old);
  303.    fclose(newrec);
  304.    remove("record.dat");
  305.    rename("new.dat","record.dat");
  306.    if(test==0)
  307.         {
  308.             printf("\nRecord not found!!\a\a\a");
  309.             erase_invalid:
  310.               printf("\nEnter 0 to try again,1 to return to main menu and 2 to exit:");
  311.               scanf("%d",&main_exit);
  312.  
  313.                  if (main_exit==1)
  314.                     menu();
  315.                 else if (main_exit==2)
  316.                     close();
  317.                 else if(main_exit==0)
  318.                     erase();
  319.                 else
  320.                     {printf("\nInvalid!\a");
  321.                     goto erase_invalid;}
  322.         }
  323.     else
  324.         {printf("\nEnter 1 to go to the main menu and 0 to exit:");
  325.         scanf("%d",&main_exit);
  326.         system("cls");
  327.         if (main_exit==1)
  328.             menu();
  329.         else
  330.             close();
  331.         }
  332.  
  333. }
  334.  
  335. void see(void)
  336. {
  337.     FILE *ptr;
  338.     int test=0,rate;
  339.     int choice;
  340.     float time;
  341.     float intrst;
  342.     ptr=fopen("record.dat","r");
  343.     printf("Do you want to check by\n1.Account no\n2.Name\nEnter your choice:");
  344.     scanf("%d",&choice);
  345.     if (choice==1)
  346.     {   printf("Enter the account number:");
  347.         scanf("%d",&check.acc_no);
  348.  
  349.         while (fscanf(ptr,"%d %s %d/%d/%d %d %s %s %lf %s %f %d/%d/%d",&add.acc_no,add.name,&add.dob.month,&add.dob.day,&add.dob.year,&add.age,add.address,add.citizenship,&add.phone,add.acc_type,&add.amt,&add.deposit.month,&add.deposit.day,&add.deposit.year)!=EOF)
  350.         {
  351.             if(add.acc_no==check.acc_no)
  352.             {   system("cls");
  353.                 test=1;
  354.  
  355.                 printf("\nAccount NO.:%d\nName:%s \nDOB:%d/%d/%d \nAge:%d \nAddress:%s \nCitizenship No:%s \nPhone number:%.0lf \nType Of Account:%s \nAmount deposited:$ %.2f \nDate Of Deposit:%d/%d/%d\n\n",add.acc_no,add.name,add.dob.month,add.dob.day,add.dob.year,add.age,add.address,add.citizenship,add.phone,
  356.                 add.acc_type,add.amt,add.deposit.month,add.deposit.day,add.deposit.year);
  357.                 if(strcmpi(add.acc_type,"fixed1")==0)
  358.                     {
  359.                         time=1.0;
  360.                         rate=9;
  361.                         intrst=interest(time,add.amt,rate);
  362.                         printf("\n\nYou will get $%.2f as interest on %d/%d/%d",intrst,add.deposit.month,add.deposit.day,add.deposit.year+1);
  363.                     }
  364.                 else if(strcmpi(add.acc_type,"fixed2")==0)
  365.                     {
  366.                         time=2.0;
  367.                         rate=11;
  368.                         intrst=interest(time,add.amt,rate);
  369.                         printf("\n\nYou will get $.%.2f as interest on %d/%d/%d",intrst,add.deposit.month,add.deposit.day,add.deposit.year+2);
  370.  
  371.                     }
  372.                 else if(strcmpi(add.acc_type,"fixed3")==0)
  373.                     {
  374.                         time=3.0;
  375.                         rate=13;
  376.                         intrst=interest(time,add.amt,rate);
  377.                         printf("\n\nYou will get $.%.2f as interest on %d/%d/%d",intrst,add.deposit.month,add.deposit.day,add.deposit.year+3);
  378.  
  379.                     }
  380.                  else if(strcmpi(add.acc_type,"saving")==0)
  381.                     {
  382.                         time=(1.0/12.0);
  383.                         rate=8;
  384.                         intrst=interest(time,add.amt,rate);
  385.                         printf("\n\nYou will get $.%.2f as interest on %d of every month",intrst,add.deposit.day);
  386.  
  387.                      }
  388.                  else if(strcmpi(add.acc_type,"current")==0)
  389.                     {
  390.  
  391.                         printf("\n\nYou will get no interest\a\a");
  392.  
  393.                      }
  394.  
  395.             }
  396.         }
  397.     }
  398.     else if (choice==2)
  399.     {   printf("Enter the name:");
  400.         scanf("%s",&check.name);
  401.         while (fscanf(ptr,"%d %s %d/%d/%d %d %s %s %lf %s %f %d/%d/%d",&add.acc_no,add.name,&add.dob.month,&add.dob.day,&add.dob.year,&add.age,add.address,add.citizenship,&add.phone,add.acc_type,&add.amt,&add.deposit.month,&add.deposit.day,&add.deposit.year)!=EOF)
  402.         {
  403.             if(strcmpi(add.name,check.name)==0)
  404.             {   system("cls");
  405.                 test=1;
  406.                 printf("\nAccount No.:%d\nName:%s \nDOB:%d/%d/%d \nAge:%d \nAddress:%s \nCitizenship No:%s \nPhone number:%.0lf \nType Of Account:%s \nAmount deposited:$%.2f \nDate Of Deposit:%d/%d/%d\n\n",add.acc_no,add.name,add.dob.month,add.dob.day,add.dob.year,add.age,add.address,add.citizenship,add.phone,
  407.                 add.acc_type,add.amt,add.deposit.month,add.deposit.day,add.deposit.year);
  408.                 if(strcmpi(add.acc_type,"fixed1")==0)
  409.                     {
  410.                         time=1.0;
  411.                         rate=9;
  412.                         intrst=interest(time,add.amt,rate);
  413.                         printf("\n\nYou will get $.%.2f as interest on %d/%d/%d",intrst,add.deposit.month,add.deposit.day,add.deposit.year+1);
  414.                     }
  415.                 else if(strcmpi(add.acc_type,"fixed2")==0)
  416.                     {
  417.                         time=2.0;
  418.                         rate=11;
  419.                         intrst=interest(time,add.amt,rate);
  420.                         printf("\n\nYou will get $.%.2f as interest on %d/%d/%d",intrst,add.deposit.month,add.deposit.day,add.deposit.year+2);
  421.  
  422.                     }
  423.                 else if(strcmpi(add.acc_type,"fixed3")==0)
  424.                     {
  425.                         time=3.0;
  426.                         rate=13;
  427.                         intrst=interest(time,add.amt,rate);
  428.                         printf("\n\nYou will get $.%.2f as interest on %d/%d/%d",intrst,add.deposit.month,add.deposit.day,add.deposit.year+3);
  429.  
  430.                     }
  431.                  else if(strcmpi(add.acc_type,"saving")==0)
  432.                     {
  433.                         time=(1.0/12.0);
  434.                         rate=8;
  435.                         intrst=interest(time,add.amt,rate);
  436.                         printf("\n\nYou will get $.%.2f as interest on %d of every month",intrst,add.deposit.day);
  437.  
  438.                      }
  439.                  else if(strcmpi(add.acc_type,"current")==0)
  440.                     {
  441.  
  442.                         printf("\n\nYou will get no interest\a\a");
  443.  
  444.                      }
  445.  
  446.             }
  447.         }
  448.     }
  449.  
  450.  
  451.     fclose(ptr);
  452.      if(test!=1)
  453.         {   system("cls");
  454.             printf("\nRecord not found!!\a\a\a");
  455.             see_invalid:
  456.               printf("\nEnter 0 to try again,1 to return to main menu and 2 to exit:");
  457.               scanf("%d",&main_exit);
  458.               system("cls");
  459.                  if (main_exit==1)
  460.                     menu();
  461.                 else if (main_exit==2)
  462.                     close();
  463.                 else if(main_exit==0)
  464.                     see();
  465.                 else
  466.                     {
  467.                         system("cls");
  468.                         printf("\nInvalid!\a");
  469.                         goto see_invalid;}
  470.         }
  471.     else
  472.         {printf("\nEnter 1 to go to the main menu and 0 to exit:");
  473.         scanf("%d",&main_exit);}
  474.         if (main_exit==1)
  475.         {
  476.             system("cls");
  477.             menu();
  478.         }
  479.  
  480.         else
  481.            {
  482.  
  483.              system("cls");
  484.             close();
  485.             }
  486.  
  487. }
  488.  
  489.  
  490. void close(void)
  491. {
  492.     printf("\n\n\n\nThis C Mini Project is developed by Code With C team!");
  493.     }
  494.  
  495.  
  496. void menu(void)
  497. {   int choice;
  498.     system("cls");
  499.     system("color 9");
  500.     printf("\n\n\t\t\tCUSTOMER ACCOUNT BANKING MANAGEMENT SYSTEM");
  501.     printf("\n\n\n\t\t\t\xB2\xB2\xB2\xB2\xB2\xB2\xB2 WELCOME TO THE MAIN MENU \xB2\xB2\xB2\xB2\xB2\xB2\xB2");
  502.     printf("\n\n\t\t1.Create new account\n\t\t2.Update information of existing account\n\t\t3.For transactions\n\t\t4.Check the details of existing account\n\t\t5.Removing existing account\n\t\t6.View customer's list\n\t\t7.Exit\n\n\n\n\n\t\t Enter your choice:");
  503.     scanf("%d",&choice);
  504.  
  505.     system("cls");
  506.     switch(choice)
  507.     {
  508.         case 1:new_acc();
  509.         break;
  510.         case 2:edit();
  511.         break;
  512.         case 3:transact();
  513.         break;
  514.         case 4:see();
  515.         break;
  516.         case 5:erase();
  517.         break;
  518.         case 6:view_list();
  519.         break;
  520.         case 7:close();
  521.         break;
  522.  
  523.     }
  524.  
  525.  
  526.  
  527. }
  528. int main()
  529. {
  530.     char pass[10],password[10]="codewithc";
  531.     int i=0;
  532.     printf("\n\n\t\tEnter the password to login:");
  533.     scanf("%s",pass);
  534.     /*do
  535.     {
  536.     //if (pass[i]!=13&&pass[i]!=8)
  537.         {
  538.             printf("*");
  539.             pass[i]=getch();
  540.             i++;
  541.         }
  542.     }while (pass[i]!=13);
  543.     pass[10]='\0';*/
  544.     if (strcmp(pass,password)==0)
  545.         {printf("\n\nPassword Match!\nLOADING");
  546.         for(i=0;i<=6;i++)
  547.         {
  548.             fordelay(100000000);
  549.             printf(".");
  550.         }
  551.                 system("cls");
  552.             menu();
  553.         }
  554.     else
  555.         {   printf("\n\nWrong password!!\a\a\a");
  556.             login_try:
  557.             printf("\nEnter 1 to try again and 0 to exit:");
  558.             scanf("%d",&main_exit);
  559.             if (main_exit==1)
  560.                     {
  561.  
  562.                         system("cls");
  563.                         main();
  564.                     }
  565.  
  566.             else if (main_exit==0)
  567.                     {
  568.                     system("cls");
  569.                     close();}
  570.             else
  571.                     {printf("\nInvalid!");
  572.                     fordelay(1000000000);
  573.                     system("cls");
  574.                     goto login_try;}
  575.  
  576.         }
  577.         return 0;
  578. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement