Sum of fourth powers of the first n natural numbers | CPP Program to find the sum of forth power of first n natural numbers ; Return the sum of forth power of first n natural numbers ; Driven Program
#include <bits/stdc++.h> NEW_LINE using namespace std ; long long int fourthPowerSum ( int n ) { return ( ( 6 * n * n * n * n * n ) + ( 15 * n * n * n * n ) + ( 10 * n * n * n ) - n ) / 30 ; } int main ( ) { int n = 6 ; cout << fourthPowerSum ( n ) << endl ; return 0 ; }