title: How to validate numeric value in c?
body: <p>When I insert character value in array my program was exit. if I insert character value, I want to continue my loop without exit program and take next integer value. 
  whats wrong in my code.</p>
  
  <p>My code: </p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;ctype.h&gt;
  
  int main()
  {
      int row1, col1, row2, col2, i, j, k, sum = 0;
      int first[10][10], second[10][10], multiply[10][10];
      clrscr();
      printf("Enter the no of rows and columns of first matrix\n");
      scanf("%d%d",&amp;row1,&amp;col1);
      printf("Enter the Element of first matrix");
      for(i=0;i&lt;row1;i++){
          for(j=0;j&lt;col1;j++){
              printf("\nEnter %d element %d row",j+1,i+1);
              scanf("%d",&amp;first[i][j]);
              check = first[i][j];
              printf("%d",check);
              if(check&gt;0 || check&lt;0)
              {
                  printf("this is digit \n");
              }
              else
              {
                  printf("this is not digit\n");
                  printf("\nEnter %d element %d row",j+1,i+1);
                  scanf("%d",&amp;first[i][j]);
              }
          }
      }
      printf("Enter the no of rows and columns of second matrix\n");
      scanf("%d%d",&amp;row2,&amp;col2);
  
      if(col1 == row2){
          printf("Enter the Element of second matrix");
          for(i=0;i&lt;row2;i++){
              for(j=0;j&lt;col2;j++){
                  printf("\nEnter %d element %d row",j+1,i+1);
                  scanf("%d",&amp;second[i][j]);
              }
          }
  
          for(i=0;i&lt;row1;i++){
              for(j=0;j&lt;col2;j++){
                  for(k=0;k&lt;row2;k++){
                      multiply[i][j]=sum;
                      sum=0;
                  }
              }
          }
          printf("Multiplication of matrices=\n");
          for(i=0;i&lt;row1;i++){
              for(j=0;j&lt;col2;j++){
                  multiply[i][j]=0;
                  for(k=0;k&lt;row1;k++){
                      multiply[i][j] += first[i][k] * second[k][j];
                  }
                  printf("%d\t",multiply[i][j]);
              }
              printf("\n");
          }
      }
      else{
          printf("You are incorrect. According to the requirement of matrix multiplication, the number of column of first matrix should equal to the number of rows of second matrix.");
      }
      getch();
      return 0;
  }
  </code></pre>
  
  <p>Thanking You</p>