title: finding next prime number of x in C
body: <pre><code>#include &lt;stdio.h&gt;
  #include &lt;math.h&gt;
  
  int is_prime(int num);
  int next_pr(int num);
  
  int main()
  {
      int num;
      scanf("%d", &amp;num);
      printf("%d\n", next_pr(num));
  
      return 0;
  }
  
  int next_pr(int num)
  {
      int c;
      if (num == 2)
          c = 3;
      else
      {
          num += 2;
          is_prime(num) ? next_pr(num) : c = num;
      }
  
      return c;
  }
  
  int is_prime(int num)
  {
      int i;
      int c = 0;
      // printf ("%f\n", sqrt (num));
      for (i = 2; i &lt;= sqrt(num); ++i)
      {
          if (num % i == 0)
              // printf ("%d\n",num%i);
              c++;
      }
      return c;
  }
  </code></pre>