void sommeascf(n)
for(i=1; i<=n; i++){
result= result+ 1/i^n
}
}
the problem I'm facing is :
result = result + 1/i^n
How can I put the power function into this arithmetic operation ?
void sommeascf(n)
for(i=1; i<=n; i++){
result= result+ 1/i^n
}
}
the problem I'm facing is :
result = result + 1/i^n
How can I put the power function into this arithmetic operation ?
^
this is bitwise XOR operator in C . You can write that expression using pow
function like this -
result= result+ 1/(pow(i,n));
Note - You need to include header <math.h>