title: How to check if user input is not an int value in C
body: <p>I need to check if a user input value is not an int value. I've tried different combinations of what I know but I either get nothing or random errors</p>
  
  <p>If the user inputs any char  it'll raise a warning message</p>
  
  <p>this is what ive written</p>
  
  <pre><code>#include &lt;stdio.h&gt; 
  
  //C program to perform addition, subtraction, multiplication, division + - * / 
  
  int main()   
  {    
      int num1,num2;
      char alpha[30]
  
      printf("enter numbers:\n\n");
  
      printf("number 1: ");
      scanf("%d",&amp;num1);
  
      printf("number 2: ");
      scanf("%d",&amp;num2);
  
      // write a funcntion that when a char is entered to display an error 
  
      if (num1//and num2 == alpha)
          printf("error");
  
  
          else {
  
      printf("Rezultat: \n");
  
      printf("sborut im e: %d\n",num1+num2);
      printf("ralikata im e: %d\n",num1-num2);
      printf("proizvedenieto im e: %d\n",num1*num2);
      printf("ralikata im e: %d\n",num1/num2);
  
              }
      return 0;
  }
  </code></pre>