title: C: How to read in multiple values using scanf in a matrix
body: <p>Hi I'm trying to write a code for user input matrix size and values. I got the bit about setting the matrix size and value, but I want to read in one row at a time so that I don't have to press enter every time after a single value input. This is my code so far. Thanks.</p>
  
  <pre><code>int row, col, i, j;
  int mat[10][10];
  
  printf("Enter number of rows: ");
  scanf("%d", &amp;row);
  printf("Enter number of columns: ");
  scanf("%d", &amp;col);
  
  for (i = 0; i &lt; row; ++i) {
      for (j = 0; j &lt; col; ++j) {
          scanf("%d", &amp;mat[i][j]);
      }
  }
  printf("\nHere is your matrix:\n");   
  for (i = 0; i &lt; row; i++) {  
      for (j = 0; j &lt; col; j++) {  
          printf("%d\t", mat[i][j]);  
      }  
      printf("\n");  
  }  
  </code></pre>