title: How to convert a math equation (summation) to a code?
body: <p>Using two functions:</p>
  
  <ul>
  <li>Factorial Function</li>
  <li>Power Function</li>
  </ul>
  
  <p>Develop a C program for the following equation:</p>
  
  <p><img src="https://i.stack.imgur.com/B8ZJf.png" alt="alt text"></p>
  
  <p>I've done this . but no output.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;math.h&gt;
  
  double factorial(double x);
  double Power_function(double y);
  
  int main(){
    double answer=0;
    double n;
    double y;
  
    printf("Enter Y :The last limit of the summation:&gt;");
    scanf("%ld",&amp;y);
    for (n=1;n&lt;=y;++n){
      answer=answer +factorial(n)*Power_function(n)*y;
    }
  
    printf("The Answer is %0.2f\n",answer);
    return 0;
  }
  
  double factorial(double x)
  {
    double ans;
    if (x==0){
      ans = 1;
    }
    else
    {
      ans = x*factorial(x-1);
    }
    return ans;
  }
  
  double Power_function(double y){
    double ans;
    ans=pow(2,y);
    return ans;
  }
  </code></pre>