Segmentation Fault
<p>Im writing a code for grocery store inventory that accepts input takes the quantity and prices calculates the value and stops after user enters 0 but when I compile after I enter the first number its say "segmentation fault". How would I fix that?</p>

<pre><code>#include&lt;stdio.h&gt;

#define MAX 100

void show();

int main(void){

long long Barcode[MAX];
int Quantity[MAX], i, k, Counter;
float Price[MAX], Value[MAX], Total;

Counter=0;

show();

do {

  printf("Barcode : ",i);
  scanf("%lld", &amp;Barcode[i]);

  printf("Price : ",i);
  scanf(" %f",&amp;Price[i]);

  printf("Quantity: ",i);
  scanf(" %d",&amp;Quantity[i]);

  Counter++;

  } while (Barcode !=0 &amp;&amp; Counter !=MAX);

  for(i=0; i&lt;Counter; i++) {

  Value[i] = (Quantity[i] * Price[i]);
 }
 printf("                 Goods In Stock               ");

 printf("Barcode           Price       Quantity    Value");
 printf("\n----------------------------------------------\n");

 for(k=0; k&lt;Counter; k++) {

 printf("%-10lld",Barcode[k]);
 printf("%5.2f",Price[k]);
 printf("%8d",Quantity[k]);
 printf("%5f",Value[k]);
 }

 printf("%8c------",' ');
 printf("\nTotal Value of goods in stock ");

return 0;

}

void show() {

 printf("Grocery Store Inventory ");
 printf("\n-----------------------\n");

}
</code></pre>