+ 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
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;
}
+ 2
include cmath, then call the pow function within a for loop