Sum of fourth powers of the first n natural numbers | CPP Program to find the sum of forth powers 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 ) { long long int sum = 0 ; for ( int i = 1 ; i <= n ; i ++ ) sum = sum + ( i * i * i * i ) ; return sum ; } int main ( ) { int n = 6 ; cout << fourthPowerSum ( n ) << endl ; return 0 ; }