Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- double product(unsigned int n)
- {
- double res = 1;
- for(unsigned int i = 1; i <= n; ++i)
- {
- res*=(pow(i,2)+4)/(2.5*i);
- }
- return res;
- }
- double sum(unsigned int n)
- {
- double res = 0;
- for(unsigned int i = 1; i <= n; ++i)
- {
- res+=(pow(i,3)+6)/(10.0 *i +1.0);
- }
- return res;
- }
- int main()
- {
- unsigned int n = 9;
- double res = product(n)*sum(n);
- printf("res = %.4lf\n",res);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement