title: Not able to retrieve string from Array
body: <p>I am writing a program to store the name of item and price using array.
  But here not able to retrieve the item name from the array. The program crashes.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  
  void main()
  {
      char itemName[100];
      int n=0, i,j, total=0, itemPrice[1];
  
      printf("Enter number of items: \n");
      scanf("%d", &amp;n);
      //fflush(stdin);
      for (i = 0; i &lt; n; i++)
      {
          printf("Item name: \n");
          scanf("%s", &amp;itemName[i]);
              for (j = i ; j&lt;=i; j++ )
  
              {
                  printf("Enter the price\n");
  
                  scanf("%d", &amp;itemPrice[j]);
  
                  total += itemPrice[j];
              }
      }
  
      for (i = 0; i &lt; n; i++)
  
          printf(" %s", itemName[i]);
  
          for (j = i ; j&lt;=i; j++)
  
              printf("\t\t%s\n", itemPrice[j]);
  
  }
  </code></pre>