title: How to check int or char in c
body: <p>I have a code where I convert celsius to fahrenheit. And I need to check what user writes char or int.</p>
  
  <p>I've tried isalpha and isdigit, but they do not work.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;ctype.h&gt;
  
  int main()
  {
      char t[] = "";
      scanf("%s", &amp;t);
      if(isalpha(t))
      {
          printf("It's char\n");
      }
      else if (isdigit(t))
      {
          printf("It's int\n");
      }
  
  
      return 0;
  }
  </code></pre>