I expect the first salesman of quarterly sales amount all change to 1 but it didn't. What's wrong with my code?Code:#include <stdio.h> #include <stdlib.h> #include <string.h> // number of salesman #define SIZE 100 // salesman_type structure definition typedef struct{ int ID; // salesman id char id_txt[6]; // salesman id for txt file char name[50]; // salesman name double hor_total; // total sales amount of a salesman }salesman_type; // end structure salesman_type salesman_type salesman[SIZE];// synonym for salesman_type // function prototype int nextId(int currentId, int isReset); int sale_menu(); void modifySales(); // function to generate id // currentId and isReset are parameters int nextId(int currentId, int isReset) { // initializes elements to 0 for the first time function is called static int lastId = 0; // if isReset is 0, assign currentId to lastId; if (isReset == 0) { lastId = currentId; } //if isReset is not 0, return and add 1 to lastId if (isReset != 0) return ++lastId; } // end function nextId // sales processing system menu function int sale_menu() { int menu; system("cls"); printf("Sales Processing System\n"); printf("-----------------------\n\n"); printf("1. Add Salesman Records\n"); printf("2. Reports Generation\n"); printf("3. Modify Salesman Records\n"); printf("4. Delete Salesman Records\n\n"); printf("0. Exit\n"); printf("Your choice: "); scanf("%d", &menu); return menu; printf("\n"); }// end function sale_menu // modify salesman records function void modifySales() { FILE *salesPtr; // sales.txt file pointer FILE *salesmanPtr; // salesman.txt file pointer int a = 1, b, modify; // counter double sale[SIZE][4]; // quartely sales amount // fopen opens the file; exits program if file cannot be opened if ( (salesPtr = fopen("sales.txt","r+")) == NULL ) { printf("Cannot open sales.txt\n"); // display error message system("pause"); // pause program before it exits exit(-1); // end program } // end if else { // prompt and read salesman id printf("\nSalesman ID (NO.): "); scanf("%d",&modify); // if it is not required salesman id while (a != modify) { fscanf(salesPtr,"%*[^\n]\n"); a++; } fscanf(salesPtr,"%*[^|]|", salesman[0].id_txt); // read quarterly sales amount for (b=0; b<4; b++) { // prompt and read quarterly sales amount printf("Quarter %d: ", b+1); scanf("%lf",&sale[0][b]); // end with "|" symbol if b is less than 3 if(b<3) { fprintf(salesPtr,"%.2f|",sale[0][b]); } else { fprintf(salesPtr,"%.2f\n",sale[0][b]); } } // end for } // end else fclose(salesPtr); // fclose close the file } // end function modifySales // function main begins program execution int main() { // nextid.txt file pointer FILE *readIdPtr; // variable declaration int a, b, c = 0, last; // counter int getMenu = 10, getReport = 10; // menu selector double ver_total = 0, max = 0; int lastId; // last saved salesman id int resetId = 0; // pass value execute assignment of nextId function // fopen opens the file; exits program if file cannot be opened if ( (readIdPtr = fopen("nextid.txt","r") ) == NULL) { printf("Cannot open nextid.txt file\n"); system("pause"); exit(-1); } // end if else { // read lastId from file fscanf(readIdPtr,"%d",&lastId); // Generate new id from previous salesman ID if the salesman is one or more // lastId and restId are arguments nextId(lastId, resetId); } // end else // fclose close the file fclose(readIdPtr); printf("\n"); while (getMenu != 0) { // call and assign sale_menu function to getMenu // Execute command based on user input switch(getMenu = sale_menu()) { case 1: break; case 2: break; case 3: modifySales(lastId); break; } // end switch }// end while return 0; } // end main