title: Repeat the c program according to user
body: <p>I want this program to repeat every time when users wants to continue.
  I want user to choose &quot;yes&quot; to continue the program using other options but it's not executable. I used 'if else' statement for that but I am not getting any applicable or satisfying results. Can someone help me on this matter?</p>
  <pre><code>#include &lt;stdio.h&gt;
  int main() {
    float a, b;
    int p;
    char q;
    printf(&quot;Enter the first number:&quot;);
    scanf(&quot;%f&quot;, &amp;a);
    printf(&quot;Enter the second number:&quot;);
    scanf(&quot;%f&quot;, &amp;b);
    printf(&quot;Choose the option:\n1.Sum\n \n2.Subtraction\n \n3.Multiplication\n \n4.Divison\n \nyour choice=&quot;);
    scanf(&quot;%d&quot;, &amp;p);
    switch (p)
    {
    case 1:
      printf(&quot;The sum of above numbers is: %f&quot;, a + b);
      break;
    case 2:
      printf(&quot;The subtraction of above numbers is:%f&quot;, a - b);
      break;
    case 3:
      printf(&quot;The multiplication of above numbers is:%f&quot;, a * b);
      break;
    case 4:
      printf(&quot;The division of above numbers is:%f&quot;, a / b);
      break;
    }
    printf(&quot;\n\nDo u want to continue:(y for yes and n for no) :&quot;);
    scanf(&quot;%c&quot;, &amp;q);
    if (q == 'y')
      return main();
    else
      return 0;
  }
  </code></pre>