title: Error assignment to expression with array type in C
body: <pre><code>#include &lt;stdio.h&gt;
  int main()
  {   
   int diff [8];
      int experiment[8]={0,1,2,3,4,5,6,7,};
      int measurements[8] ={0,1,2,3,4,5,6,7};
      int counter;
      int socre;
      char output;
      printf("Please enter the measurement for %d \n\n",measurements[0]);
      scanf("%d",&amp;experiment[0]);
      printf("Please enter the measurement for %d \n\n",measurements[1]);
      scanf("%d",&amp;experiment[1]);
      printf("Please enter the measurement for %d \n\n",measurements[2]);
      scanf("%d",&amp;experiment[2]);
      printf("Please enter the measurement for %d \n\n",measurements[3]);
      scanf("%d",&amp;experiment[3]);
      printf("Please enter the measurement for %d \n\n",measurements[4]);
      scanf("%d",&amp;experiment[4]);
      printf("Please enter the measurement for %d \n\n",measurements[5]);
      scanf("%d",&amp;experiment[5]);
      printf("Please enter the measurement for %d \n\n",measurements[6]);
      scanf("%d",&amp;experiment[6]);
      printf("Please enter the measurement for %d \n\n",measurements[7]);
      scanf("%d",&amp;experiment[7]);
      printf("Congratulations ! you have all done.here is the result");
      printf("\nReal value for 0 : 100 ! but your experiment value is : %d",experiment[0]);
      printf("\nReal value for 1 : 100 ! but your experiment value is : %d",experiment[1]);
      printf("\nReal value for 2 : 200 ! but your experiment value is : %d",experiment[2]);
      printf("\nReal value for 3 :  50 ! but your experiment value is : %d",experiment[3]);
      printf("\nReal value for 4 :  90 ! but your experiment value is : %d",experiment[4]);
      printf("\nReal value for 5 : 265 ! but your experiment value is : %d",experiment[5]);
      printf("\nReal value for 6 :  45 ! but your experiment value is : %d",experiment[6]);
      printf("\nReal value for 7 :  56 ! but your experiment value is : %d",experiment[7]);
      printf("Please wait........");
       {
         diff=abs(experiment[2]-100)*100 /100;
          if (diff&lt;1)
          {
           printf("\nThe score is = 8");
          }
           else if(diff&lt;10)
          {
             printf("\nThe core is = 4");
          }
           else
          {
            printf("\nThe score is =0");
          }
       }
      return 0;   
  }
  </code></pre>
  
  <p>I got <strong>[Error] assignment to expression with array type</strong> once I compile this. The error line is <strong>diff=abs(experiment[2]-100)*100 /100;</strong></p>
  
  <p>Could you please also tell me the shortest path to print my experiment values and get outputs (using for loop)?  If you can't fix this, please re-write the code for me. I've attached a <a href="http://postimg.org/image/6snh6bo33/" rel="nofollow">link</a> to this homework question.</p>