C programming help

My professor has written a statement about the assignment turned in that I am unsure of what he exactly means. The next assignment will be the final assignment and I would like to be accurate with it. This is what he said," In one area you have jumped a bit ahead although you are not totally complete with the solution. In addition to capturing name and state in arrays you also need to capture age and calculate that average age in the end. Age should also be in an array. You are missing your plan to test this when you finish. When you finish you should update this document and add the final code and output sections and resubmit in Week 8 as a completed project. Good luck."

This is what I turned in.

Program Description:
This program will allow a user to Input a list of their family members along with their age and state where they reside. It will determine and print the average age of their family and will tell you if they are from Texas.

Analysis:
With this code you will simply change out the input for names<5 and sum/5 to the number of family members you will be entering. Once you change the number of family members you can then run the program and answer the questions that follow. Once the first questions are answered it will inform you if the family member was from Texas. It will then ask for the ages of the family members you entered and then give you the average. The input for the code is names, age, and sum. The different characters are the states and name. The float will be average.

C Code:
#include <stdio.h>
#include <string.h>
void main()
{
int names,age,sum;
char state[50], name[50];
float avg;
for (names=0; names<5; names++)
{
// reset Sum to 0 sum =0;
printf(“Enter a family members name:\n”, name);
gets(name);
printf(“The name you entered was: %s \n”, name);
printf(“Enter the abbreviation for the State that %s lives in (for example: MD, TX, CA, NY):\n”, name);
gets (state);
printf(“You entered %s \n”, state);
if ( strcmp(state,“TX”)== 0) printf("%s is from Texas\n", name);
else printf("%s is not from Texas… \n", name);
}
sum=0;
for (names=0; names <5; names++)
{
printf(“enter the ages:”);
scanf("%d",&age); sum=sum+age;
}
{
avg=sum/5;
printf(“Average: %f”,avg);
getch();
}
return 0;
}

Update:

remove getch(); as getch(); is not defined in standard gcc compilers.

And can you please tell what exactly is the problem faced by you?

try replacing getch(); with system("pause");.

But again, this is platform - specific.

You have to remove the getch(); because this not a function of conio.h as per standard.

Best Essay Writing Service UK

//