- #1
anonim
- 40
- 2
- Homework Statement
- Calculate the sum of the square root
- Relevant Equations
- -
C:
#include<stdio.h>
#include<math.h>
double foo(int n){
if(n==1){
return(1);
}
if(n!=0){
return( sqrt((n)+foo(n-1) ) );
}
}
int main(){
int num;
printf("Enter the number: ");
scanf("%d",&num);
foo(num);
printf(" %lf ",foo(num));
return(0);
}