#include <stdio.h>
#include <stdlib.h>
int main()
{
int n=8;
printf("%d\n",func(n));
return 0;
}
func(int n)
{
if(n==0)
return 0;
else
return(n+func(n-1));
}
output::
36
#include <stdlib.h>
int main()
{
int n=8;
printf("%d\n",func(n));
return 0;
}
func(int n)
{
if(n==0)
return 0;
else
return(n+func(n-1));
}
output::
36
No comments:
Post a Comment