title: how do i add all the elements of the for loop?
body: <pre><code>#include &lt;stdio.h&gt;
  int even_numbers_sum(){
      int d;
      for(d=0;d&lt;=100;d++){
          if(d%2==0){
              printf(&quot;\n this is even number loop %d&quot;,d);
          }
      }
      int sum;
      sum=sum+d;
      printf(&quot;\n the value of total sum of the loop %d&quot;,sum);
      return sum;
  }
  int main(){
      even_numbers_sum();
  }
  </code></pre>
  <p>my main aim is to calculate the sum of all the elemets of for loop i took a for loop and described its value and put a equation (if) to pass anynumber if its only even other wise it will not work and i have to add all those even number till 100 how do i do it</p>