/* Recursive Function */
/* Sum of the following series
	1+ 2+ 3+ ........+n	*/
#include< stdio.h>
#include< conio.h>
main()
{
	int n,result;
	clrscr();
	printf("enter the number of values\n");
	scanf("%d",&n);
	result=sum(n);
	printf("sum of the series=%d",result);
	getch();
}
sum(int n)
{
	int answer;
	if (n==1)
		return n;
	else
		answer=n+sum(n-1); // recursive function call
		return answer;
}