You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
#include<stdio.h>
int main()
{int n;
int num(int n);
printf("enter the value of n:");
scanf("%d",&n);
int sum=num(n);
printf("\n sum of number from 1 to %d is %d",sum);
return(0);
}
int num(int n)
{
int m;
if(n==1)
{
return(1);
}
else
{
m=n+num(n-1);
return(m);
}
}
#10