by Dinesh Thakur

 

#include<iostream.h>

#include<conio.h>
void main()
{
      int total,sum(int);
      clrscr();
      total=sum(2);
      cout<<"Sum Of All Even Numbers From 0 To 20 : "<<total;
      getch();
}
        int sum(int i)
         {
            static int even=0;
            if(i<=20)
             {
                 even=even+i;
                 sum(i+2);
              }
            return even;
          }

Sum Of All Even Numbers From 0 To 20 Using Function Recursion