Q:

Program not outputting string stored in array

I'm writing a program to display names and the number of apartments however, my array storing the names is unable to display the names saying that they're unidentified. Is there anyway to have the string contained in the array to display? Also, I seem to get the value of n displaying beneath the number of apartments in the display, is there anyway to get rid of this? Here's my code:
#include <stdio.h>

int main(void)
{
    int i;
    char name[] = {North, West, South, East};
    int apt[] = {24, 30, 14, 18};
    const int n = 5;

    printf("Name    No. of Apartments\n");
    for (i = 0; i < n; i++)
            printf("%c        %d\n", name[i],  apt[i]);

    return 0;

}

A:

You are declaring a name as a one-dimensional array, when it needs to be a two-dimensional array.
char name[number of names][length of longest name + 1]
Additionally, the strings used for directional names need to be encapsulated in double quotes.
So your declaration should look something like this:
char name[4][6] = {"North", "West", "South", "East"};
When printing a character array, use the designator %s.  %c is only used for single characters:
printf("%s        %d\n", name[i],  apt[i]);
Additionally, since the for loop starts at index 0, 'n' should be changed from 5 to 4:
const int n = 4;

