Wednesday 18 January 2017

Employee Management System in C Language

Code:

#include<stdio.h>
#include<time.h>
#include<stdlib.h>
#include<conio.h>
#include<windows.h>
#include<string.h>

#define OR ||
#define AND &&

void mainmenu();
void logo();
void delay(int milliseconds);
int ti(void) ;
void logout();
void login();
void add();
void display();
void edit();
void dlt();
void search();
void wrong();

struct employee
{  
    int id;
char name[30];
    char fname[30];
    char dob[30];
char cnic[18];
char qualif[30];
char service[15];
char eskills[50]; 
char ph[15];
char email[15];
char scale[10];
int sal;
}e;





main()
{
system( "mode con:cols=80 lines=40" );
logo();
login();
}


void mainmenu()
{
system( "mode con:cols=80 lines=40" );
system("color 80");
system("cls");
char more;
int sz;
sz=sizeof(e);
printf("\n\n\n");
    printf("\t\t\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2");
   printf("\n                                WELCOME TO EMS");
    printf("\n\t\t\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2");  
                                                                                 printf("\t\t\t\t\t\t\t\t    Welcome CEO Furqan");

  char a;
    printf("\n\n\t\t\t           MANAGER MENU ");
printf("\n\n");
printf("\n\t\t%c 1. Add Employee record\n",16);
    printf("\n\t\t%c 2. Display Employee Reocords\n",16);
printf("\n\t\t%c 3. Delete Emplyee Records \n",16);    
    printf("\n\t\t%c 4. Modify Emplyee Records\n",16);  
    printf("\n\t\t%c 5. Search Emplyee\n",16); 
    printf("\n\t\t%c 6. Logout (Admin)\n",16);
    printf("\n\n\n\n\n\t\t\t   Press your choice key!");
  
  a=getch();
  
  switch(a)
  {
     case '1':
      fflush(stdin);
add();                               
break;
case '2':
display();
break;
case '3':
     
      dlt();
      break;
      case '4':
    
      edit();
      break;        
   case '5':
            
search();        
break;        
             
    case '6':
    logout();
   
    default:
    wrong();
}    
}


void logout()
{
system("color 80");
system("cls");
int i;
printf("\n\n\n\n\tAutomatically logging out in 5 seconds. Please wait");
for(i=0;i<4;i++)
{
printf(".");
delay(1000);
}
exit(0);
}

void wrong()
{
system("cls");
system("color 46");

        printf("\n\n\n\n\n");                                                                   
printf("\n\n\t88888888888 88888888ba  88888888ba    ,ad8888ba,   88888888ba  \n"); 
printf("\t88          88      \"8b 88      \"8b d8 \" \'    `\"8b 88  \"    8b  \n");
printf("\t88          88      ,8P 88      ,8P d8'        `8b 88      ,8P  \n");
printf("\t88aaaaa     88aaaaaa8P' 88aaaaaa8P' 88          88 88aaaaaa8P'  \n");
printf("\t88\"\"\"\"\"     88\"\"\"  88\'  88\"\"\"  88 \' 88          88 88\"\"\"\"88\'    \n");
printf("\t88          88    `8b   88    `8b   Y8,        ,8P 88    `8b    \n");
printf("\t88          88     `8b  88     `8b   Y8a.    .a8P  88     `8b   \n");
printf("\t88888888888 88      `8b 88      `8b   `\"Y8888Y\"'   88      `8b  \n");
  printf("\n\n\n\n\t\tOpppsssss!!! ");
 printf("\n\t\tYou enterd a wrong option. \n\n\n\t\tPlease press any key to re-enter....");
if(getch())
mainmenu();

}

COORD coord = {0, 0};
COORD max_res,cursor_size;
void gotoxy (int x, int y)
{
        coord.X = x; coord.Y = y;
        SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
}
void logo()
{
system("color 80");
system( "mode con:cols=80 lines=40" );
 
printf("\n\n\n\n\n\n\n\n");
printf("\t\t88888888888 88b           d88  ad88888ba\n");
printf("\t\t88          888b         d888 d8\"     \"8b\n");
printf("\t\t88          88`8b       d8'88 Y8,         \n");
printf("\t\t88aaaaa     88 `8b     d8' 88 `Y8aaaaa,    \n");
printf("\t\t88\"\"\"\"\"     88  `8b   d8\'  88   `\"\"\"\"\"8b  \n");
printf("\t\t88          88   `8b d8\'   88         `8b  \n");
printf("\t\t88          88    `888\'    88 Y8a     a8P  \n");
printf("\t\t88888888888 88     `8\'     88  \"Y88888P\"   \n");
printf("\n\n\n\n  +-+-+-+-+-+-+-+-+-+-++-+-++-+-+-+-+-+-+-+-+-+-+-++-+-+-++-+-+-+-+-+-+-+-+-+-+\n");
printf("                      | EMPLOYEE MANAGEMENT SYSTEM |\n");
printf("  +-+-+-+-+-+-+-+-+-+-++-+-++-+-+-+-+-+-+-+-+-+-+-++-+-+-++-+-+-+-+-+-+-+-+-+-+\n");
int i;
printf("\n\n\n\n\n\n\n\n\t\tLoding........");
printf("\n         \t");
for(i=0;i<=50;i++)
{
printf("\xB2");
}
printf("\r");
printf("        \t");
for(i=0;i<=50;i++)
{
 printf("\xDB");
 delay(100);
}
}

    void delay(int milliseconds)
{
    long pause;
    clock_t now,then;

    pause = milliseconds*(CLOCKS_PER_SEC/1000);
    now = then = clock();
    while( (now-then) < pause )
        now = clock();
}


void red_scr()
{
system("cls");
system("color 40");
}

void green_scr()
{
system("cls");
system("color 20");
}



void login()
{
system( "mode con:cols=80 lines=40" );
system("cls");
system("color 80");
fflush(stdin);
printf("\n\n\n");
   printf("\n\t\t\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2");
   printf("\n                             WELCOME TO MANAGER LOGIN");
   printf("\n\t\t\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2");
   
fflush(stdin);
char user[]="admin";
char password[]="admin";
char get_usr[50];
char get_pswd[50];
char ch;
    int i=0;
printf("\n\n\n\n\t\tEnter Username: ");
gets(get_usr);
   fflush(stdin);    
   
   printf("\n\t\tEnter Password: ");
while(ch!=13)
   {
ch=getch();

if(ch!=13 && ch!=8){
putch('*');
get_pswd[i] = ch;
i++;
}
   }
  
   get_pswd[i] = '\0';
   if(strcmp(get_pswd,password)==0  && strcmp(get_usr,user)==0)
   {
    system("cls");
    green_scr();
printf("\n\n\n\n\t\tCorrect Login details");
printf("\n\t\tYou have logged In Successfully..!");
printf("\n\t\tPress any key to countinue.....");
if(getch());
mainmenu();
   }
   else
   {
red_scr();
printf("\a\n\n\n\n\t\tWarning!!\n\n\t\tIncorrect Login details.\n\n\t\tUsername or Password is incorrect");
printf("\n\n\t\tPress any key to re-login");
printf("\n\n\t\tPress \'Y\' to Exit");
char bc;
bc=getch();
if((bc=='y' || bc=='Y'))
{
exit(0);
}
else 
login(); 
   }
}



void add()
{
system("color 80");
system( "mode con:cols=80 lines=40" );
system("cls");
printf("\n\n\n");
    printf("\t\t\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2");
   printf("\n                                 EMS");
    printf("\n\t\t\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2");
   
printf("\n\n\t\t\t       ADD EMPLOYEE RECORD ");
FILE *fp;
    int sz;
char more; 
     int etc;
fp=fopen("data.dat","rb+");

                           if(fp==NULL)
                             {
       
                                fp=fopen("data.dat","wb+");
                           if(fp==NULL)
                              {
                              puts("Sorry! Databse Error Occured! :(");
                              exit(1);
                             }
                                }
sz=sizeof(e);
        fflush(stdin);
        char ch;
        more='y';
        while((more=='y') OR (more=='Y'))
        {
            
printf("\n\n\n\t\t Enter the Id of Employee: ");
scanf("%d",&e.id);  
fflush(stdin);
        printf("\n\t\t Enter the Name of Employee: ");
fflush(stdin);
gets(e.name);
fflush(stdin);
printf("\n\t\t Enter the Father Name of Employee: ");
gets(e.fname);
fflush(stdin);
         
     printf("\n\t\t Enter the CNIC of Employee: ");
gets(e.cnic);
fflush(stdin);
       printf("\n\t\t Enter the Qualif of Employee: ");
gets(e.qualif);
fflush(stdin);
 
       printf("\n\t\t Enter the Cell# of Employee: ");
gets(e.ph);
fflush(stdin);
       printf("\n\t\t Enter the Sallery of Employee: ");
scanf("%d",&e.sal);
if(e.sal>=45000)
{
strcpy(e.scale,"FIRST");
}
   else if((e.sal>=30000)&&(e.sal<45000))
{
strcpy(e.scale,"SECOND");
}
   else if((e.sal>=15000)&&(e.sal<30000))
{
strcpy(e.scale,"Third");
}
else {
strcpy(e.scale,"NILL");
}
fseek(fp,0,SEEK_END);   
fwrite(&e,sz,1,fp);
   printf("\n\n   \aEmployee record successfully saved. Do you want add another record? [Y/n] ");
fflush(stdin);
more=getche();
printf("\n\t\t<----------------------------------------------->");

  } 
      fclose(fp);
    printf("\n\n\t   Press any key to goto Main Menu.");
    if(getch());   
    mainmenu();
   
}




void display()
{
system("color 80");
system( "mode con:cols=145 lines=50" );
system("cls");
FILE *fp;
    int sz;
char more; 
fp=fopen("data.dat","ab+");
                           if(fp==NULL)
                             {
                                      fp=fopen("data.dat","wb+");
                           if(fp==NULL)
                              {
                              puts("Sorry! Databse Error Occured! :(");
                              exit(1);
                             }
                                }
sz=sizeof(e);
          printf("\n\t\t\t\t\t\t\t    \xDB\xB2 EMPLOYEE RECORDS \xB2\xDB\n\n");
printf("  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+--+-+-+-+\n");
printf("  +  ID  |       NAME     |   FATHER NAME   |           CNIC         |    QUALIFICATION    |     PHONE#    |   SCALE   |        SALLERY       +\n");                                                                        +   
printf("  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n");
rewind(fp);

                  int j=6;                                                                       
while(fread(&e,sz,1,fp)==1)
{
        gotoxy(2,j);
printf("+ %d ",e.id);
gotoxy(9,j);
printf("|");
gotoxy(11,j);   
printf("%s",e.name);
 gotoxy(26,j);
printf("|");
gotoxy(29,j);
printf("%s",e.fname);
gotoxy(44,j);
printf("|");
gotoxy(47,j);         
printf("%s",e.cnic);
gotoxy(69,j);
printf("|");
gotoxy(72,j);
  printf("%s",e.qualif);
gotoxy(91,j);
printf("|") ;
gotoxy(94,j);
printf("%s",e.ph);
  gotoxy(107,j);
printf("|") ;
    gotoxy(111,j);
printf("%s",e.scale);
gotoxy(119,j);
   printf("|") ;
gotoxy(123,j);
printf("%d",e.sal);
gotoxy(142,j);
printf("+");
j++; 
}
printf("\n  +--+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+");
fclose(fp);

printf("\n\n\n\t\t    Press any key to goto Manager Menu ");
if(getch());
mainmenu();
}


void search()
{
system("cls");
FILE *fp;
    int sz;
char more; 
char etc[20];
int flag=0;
fp=fopen("data.dat","rb+");
                           if(fp==NULL)
                             {                            
fp=fopen("data.dat","wb+");
                           if(fp==NULL)
                              {
                              puts("Sorry! Databse Error Occured! :(");
                              exit(1);
                             }
                                }
sz=sizeof(e);
printf("\n\n\n");
    printf("\t\t\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2");
   printf("\n                                 EMPLOYEE MANAGEMENT SYSTEM");
    printf("\n\t\t\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2");
printf("\n\n\t\t\t        SEARCH EMPLOYEE ");
     
 
 
            fflush(stdin);
           printf("\n\n\n\n\t\t  > Enter the Employee name to search: ");
        gets(etc);

while(fread(&e,sz,1,fp)==1)
{
if(strcmpi(e.name,etc)==0)
{
      flag=1;
      break;
  }
  
}
if(flag==1){
system("cls");                                                                  
      system( "mode con:cols=145 lines=50" );
printf("  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+--+-+-+-+\n");
printf("  +  ID  |       NAME     |   FATHER NAME   |           CNIC         |    QUALIFICATION    |     PHONE#    |   SCALE   |        SALLERY       +\n");                                                                        +   
printf("  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n");
rewind(fp);

                  int j=3;                                                                       
        gotoxy(2,j);
printf("+ %d ",e.id);
gotoxy(9,j);
printf("|");
gotoxy(11,j);   
printf("%s",e.name);
 gotoxy(26,j);
printf("|");
gotoxy(29,j);
printf("%s",e.fname);
gotoxy(44,j);
printf("|");
gotoxy(47,j);         
printf("%s",e.cnic);
gotoxy(69,j);
printf("|");
gotoxy(72,j);
  printf("%s",e.qualif);
gotoxy(91,j);
printf("|") ;
gotoxy(94,j);
printf("%s",e.ph);
  gotoxy(107,j);
printf("|") ;
    gotoxy(111,j);
printf("%s",e.scale);
gotoxy(119,j);
   printf("|") ;
gotoxy(123,j);
printf("%d",e.sal);
gotoxy(142,j);
printf("+");
j++; 
printf("\n  +--+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+");

}




fclose(fp);
if(flag==0)
{
printf("\n\n\n\t\aRecord not found.");
}


printf("\n\tPress any key to goto Main Menu ");
if(getch());
mainmenu();
}



void dlt()
{
system("color 80");
 system("cls");
FILE *fp,*ft;
    int sz;
char more; 
   int etc;
   char ch;
    printf("\n\n\n");
    printf("\t\t\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2");
   printf("\n                                 EMS");
    printf("\n\t\t\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2");
   printf("\n\n\t\t\t      DELETE EMPLOYEE DATA ");
more='y';
       while((more=='y') OR (more=='Y'))
        {
    
fp=fopen("data.dat","rb+");
                   if(fp==NULL)
                             {
                    fp=fopen("data.dat","wb+");
                           if(fp==NULL)
                              {
                              puts("Sorry! Databse Error Occured! :(");
                              exit(1);
                             }
                                }     
sz=sizeof(e);
ft=fopen("temp.dat","wb");
        fflush(stdin);
        printf("\n\n\n\n\t\t  > Enter the Employee id to delete: ");
        scanf("%d",&etc);
rewind(fp);
   while(fread(&e,sz,1,fp)==1)
       
       
        if(etc!=e.id)
        {
        fseek(ft,0,SEEK_CUR);
        fwrite(&e,sz,1,ft);
        }
    
}
fclose(fp);
fclose(ft);
remove("data.dat");
rename("temp.dat","data.dat");
printf("\n\n\n   \aRecord successfully delted. ");
printf("Do you want to delete any other record? [Y/n] ");
more=getch();
printf("\n\t\t<----------------------------------------------->");

}

    printf("\n\n\t\t        Press any key to goto Main Menu.");
if(getch());
mainmenu();
}


void edit()

{
    
    
    system("color 80");
    system("cls");

    FILE *fp;
    int sz;
char more; 
int flag=0;
int etc,zzz;
sz=sizeof(e);


printf("\n\n\n");
    printf("\t\t\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2");
   printf("\n                                 EMS");
    printf("\n\t\t\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2");
   
printf("\n\n\t\t\t    MODIFY EMPLOYEE RECORDS ");    
fp=fopen("data.dat","rb+");

                           if(fp==NULL)
                             {
       
                                fp=fopen("data.dat","wb+");
                           if(fp==NULL)
                              {
                              puts("Sorry! Databse Error Occured! :(");
                              exit(1);
                             }
                                }
    fflush(stdin);
        printf("\n\n\n\n\t\t  > Enter the Employee id to modify: ");
        scanf("%d",&etc);
       while(fread(&e,sz,1,fp)==1)
       
                               if(etc==e.id)
                                     {
                                      flag=1;      
                                   break;
                                         }
                                           }


        if(flag==1){
       
          printf("\n\n\n\t\tEnter the Id of Employee (new): ");
scanf("%d",&e.id);  
fflush(stdin);
        printf("\n\t\tEnter the Name of Employee (new): ");
fflush(stdin);
gets(e.name);
fflush(stdin);
printf("\n\t\tEnter the Father Name of Employee (new): ");
gets(e.fname);
fflush(stdin);
         
     printf("\n\t\tEnter the CNIC of Employee (new): ");
gets(e.cnic);
fflush(stdin);
       printf("\n\t\tEnter the Qualification of Employee (new): ");
gets(e.qualif);
fflush(stdin);
 
       printf("\n\t\tEnter the Cell# of Employee (new): ");
gets(e.ph);
fflush(stdin);
       printf("\n\t\tEnter the Sallery of Employee (new): ");
scanf("%d",&e.sal);
if(e.sal>=45000)
{
strcpy(e.scale,"FIRST");
}
   else if((e.sal>=30000)&&(e.sal<45000))
{
strcpy(e.scale,"SECOND");
}
   else if((e.sal>=15000)&&(e.sal<30000))
{
strcpy(e.scale,"Third");
}
else {
strcpy(e.scale,"NILL");
}
                    fseek(fp,-sz,SEEK_CUR);
                fwrite(&e,sz,1,fp);
                
printf("\n\n\t\aRecord Modified Successfully.press any key to goto main menu.");
fclose(fp);      
if(getch());
             mainmenu();        
         }
        
         else
         {
          fclose(fp);   
          printf("\n\n\n\t\aRecord NOT found. press any key to goto main menu.");
            if(getch());
             mainmenu();        
         }
}

No comments:

Post a Comment