//Arrays Question 3 solution
#include <stdio.h>

void main()
{
	int i;
	int choice;
	//Part a - set up character array
	char names[10][8] = { "Bob", "James", "Kim", "Bev", "Gareth", "Nik", "Gaynor","Gary", "Steve","Kapilan" };

	//Part b - set up integer array
	int phone[10] = { 4234,4235,4111,4121,4656,4325,4512,4511,4792,4987 };

	//Part c - print out names with phone numbers
	for (i = 0; i <= 9; i++)
	{
		printf("%s %d\n", names[i], phone[i]);
	}

	printf("-----------------------------------\n");

	//Part d - search for a name associated with an extension number
	printf("Please enter an extension number: ");
	scanf("%d", &choice);

	for (i = 0; i <= 9; i++)
	{
		if (choice == phone[i])
		{
			printf("That is the phone number for %s\n", names[i]);
		}
	}


}