+ 2

Can anyone help me a program that calculate sum of n^10 from 2 to 10

sum of n^10 from 2 to 10

8th May 2017, 11:39 PM
Joe Justin
Joe Justin - avatar
2 Respuestas
+ 11
#include <iostream> #include<cmath> using namespace std; int main() { float sum = 0; for(int i = 2; i <= 10; i++){ sum +=pow(i, 10); } cout << sum; }
9th May 2017, 12:10 AM
Mohammad Dakdouk
Mohammad Dakdouk - avatar
+ 2
include cmath, then call the pow function within a for loop
9th May 2017, 12:09 AM
Jadude