Q:

Access violation when trying to run a very simple program

"Unhandled exception at 0x0F29F365 (msvcr120d.dll) in HW2_1_JM.exe:
  0xC0000005: Access violation reading location 0xFFFFFFFF."

This is my first post, and that is the error I consistently get when I attempt to run this program. I'm new to programming, so I'm sorry for my code quality.  When it's not throwing this error, it's simply pausing endlessly before the while. We think the error is with int d because when we tried to print both n and d we get the error again after printing n. 
int main()
{
   int a[10];
   puts("Please input a value: \n");
   int n;
   scanf("%i", &n);
   printf("\n you chose: %i\n", n);
   puts("Please input a base value, between 1 and 11: \n");
   int d;
   scanf("%i", &d);

   while (!(n = -1));
   {
      int q = n;
      int k = 0;
      printf(q);
      while (q != 0);
      {
         a[k] = (q % d);
         q = q / d;
         printf(q);
         k++;
      }
      for (int j = 0; j < 11; j++)
      {
         printf("Element [%d] = %d \n", j, a[j]);
      }
      puts("Please input a value: \n");
      scanf("%i", &n);
      printf("\n you chose: %i\n", n);
      puts("Please input a base value, between 1 and 11: \n");
      scanf("%i", &d);
   }
   system("pause");
   return 0;
}

A:

You have a 10-item array, but try to read 11 elements (0 through 10). Change your loop to:
for (int j = 0; j < 10; j++)
  {
     printf("Element [%d] = %d \n", j, a[j]);
  }

Also, this is wrong:
while (!(n = -1));
{

You're doing an assignment when you want to do a comparison. And you have a misplaced ;. Your code should be
while (n != -1)
{

