This is my code.. in the rent function when it gets to the type of car and i choose a number.. it's suppose to go into the entry function and do what it's suppose to do but instead it just says that the program has stopped working.. can anyone help? Screenshot by Lightshot The returning is at the start because i took out the function for it to test the rental aloneCode:#include <stdio.h> #include <conio.h> void Rent(void); float entry(int); float discount(int,float); int j=0; struct rental { char firstname[20]; char lastname[20]; int number[10]; char address[40]; int age; }rents[40]; int main() { int num1; printf("Welcome to Ollivierre's Car Rental Service!\nDo you want to rent a car or are you returning one?\n1.Renting\n2.Returning\n0.Exit\n"); scanf("%d",&num1); while (num1!=0) { switch (num1) { case 1: Rent(); break; } } printf("Have a nice day!"); return 0; } void Rent() { int entrance,num2,num3,num4,car; float rate,discop; FILE *rentPtr; rentPtr=fopen("Rental.txt","w"); printf("You have chosen to rent a car\n"); printf("Please Enter your First name: \n"); scanf("%s",&rents[j].firstname); printf("Please Enter your Last name: \n"); scanf("%s",&rents[j].lastname); printf("Please Enter your Address: \n"); scanf("%s",&rents[j].address); printf("Please Enter your Telephone Number: \n"); scanf("%d",&rents[j].number); printf("Please Enter your Age(Must be at least age 20)): \n"); scanf("%d",&rents[j].age); entrance=rents[j].age; if (entrance>20) { printf("What type of vehicle would you like?\nThese are the vehicles available.\n"); printf("1.Toyota Camry($30)\n2.Mitsubishi lancer($60)\n3.Bugatti veyron($95)\n4.Lamborghini gallardo ($90)\n5.Nissan Altima($80)\n6.mitsubishi galant ($45)\n"); printf("Which vehicle would you like to rent?\n"); scanf("%d",num2); car=entry(num2); printf("The price of your car per day is %0.2f",car); printf("How many days will you be renting this car for?: \n"); scanf("%d",num4); rate=car*num4; if (num4>10) { discop=discount(num4,rate); printf("You are renting the car for: %d day(s).\nThe price would be: %0.2f\n",num4,discop); } else { if (num4<10) { printf("You are renting the car for: %d day(s).\nThe price would be %0.2f",num4,rate); } } fprintf(rentPtr,"Firstname\tLastname\tAddress\tNumber\tAge"); fprintf(rentPtr,"\n"); fprintf(rentPtr,"%s\t%s\t%s\t%d\t%d",rents[j].firstname,rents[j].lastname,rents[j].address,rents[j].number,rents[j].age); fclose(rentPtr); } else { if (entrance<=19) { printf("You are too young to rent a car!\n"); } } printf("Have a nice day!"); } float entry(int a) { float price; if (a==1) { price=30; } else { if (a==2) { price=60; } else { if (a==3) { price=95; } else { if (a==4) { price=90; } else { if (a==5) { price=80; } else { if (a==6) { price=45; } } } } } } return price; } float discount (int b,float c) { float disco; if ((b>10)&&(b<21)) { disco=c-(c*.02); } else { if ((b>20)&&(b<41)) { disco=c-(c*.05); } else { if (b>40) { disco=c-(c*.10); } } } return disco; }