title: Error: invalid lvalue in assignment [in c]
body: <p><strong>CAN'T FIND WHAT'S WRONG...</strong></p>
  
  <p>I have been programming and trying to fix a problem here but I can't find a bug. Could you guys help me advice what did I code wrong in this program? It will be thankful :)</p>
  
  <p>This is what complier said after I complied the program:</p>
  
  <pre><code>In function 'main':
  Line 40: error: invalid lvalue in assignment
  </code></pre>
  
  <p>which is: </p>
  
  <pre><code>/*Calculate area for single room*/
  width * length = totalArea_single;
  </code></pre>
  
  <p>And here's the whole code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  /*Main function of this program*/
  int main()
  {
  char input[512];/*buffer*/
  char roomInput[512];/*buffer*/
  int roomCount =0;/*Store number of room*/
  int width =0;/*width integer*/
  int length =0;/*length integer*/
  int room =0;/*To make sure roomCount have to be more than 0*/
  int totalArea_single =0;
  int totalArea_all =0;  
  
  /*Ask how many room in the house*/
  printf("\nHow many rooms in the house?: ");
  fgets(input,sizeof(input),stdin);
  sscanf(input,"%d",&amp;roomCount);
  
  /*For loop for calculating room area by number of room entered*/
  for(room=0;room&lt;roomCount;room++)
  {
      /*Input for width and have to be more than 0*/
      while(width&gt;0)
      {
          printf("Width in meters for room %d: ",room+1);
          fgets(roomInput,sizeof(roomInput),stdin);
          sscanf(roomInput,"%d",&amp;width);
      }
  
      /*Input for length and have to be more than 0*/
      while(length&gt;0)
      {
          printf("Length in meters for room %d: ",room+1);
          fgets(roomInput,sizeof(roomInput),stdin);
          sscanf(roomInput,"%d",&amp;length);
      }
  
      /*Calculate area for single room*/
      width * length = totalArea_single;
  
      /*Store area of all rooms*/
      totalArea_all = totalArea_single + totalArea_all;
  
      width = -1;
      length = -1;
  }
  
  /*Print out total areas of the house*/
  printf("\nTotal areas of the house is %d square meters",totalArea_all);
  
  return 0;
  }
  </code></pre>
  
  <p>I'm not sure what did I do wrong... Thanks for your help :)</p>