Revised my code a bit. Not sure if my arrays were initiated properly or not. But they should be now if they weren't before.
Still have the same issue though.
Code:
#include <stdio.h>
int main()
{
int i = 0;
int FamilyAges[5]={0};
char FamilyMembers[5];
char FamilyLocations[5];
float TotalAge = 0;
float NumFamily = 0;
float AverageAge;
while (i<5)
{
printf("Input the name of the family members: \n");
scanf("%s", &FamilyMembers[i]);
i++;
}
i=0;
while (i<5)
{
printf("Input the age of the family members: \n");
scanf("%d", &FamilyAges[i]);
TotalAge = FamilyAges[i] + TotalAge;
NumFamily++;
i++;
}
i=0;
while (i<5)
{
printf("Input the Location of the family members: \n");
scanf("%s", &FamilyLocations[i]);
i++;
}
i=0;
printf("The total number of family members is: %f\n", NumFamily); /*for testing purposes */
printf("The total age of family members is: %f\n", TotalAge); /*for testing purposes*/
AverageAge = (TotalAge / NumFamily);
printf("The average age of the family members is %f\n", AverageAge);
return 0;
}