Sum of fourth powers of first n odd natural numbers | CPP Program to find the sum of fourth powers of first n odd natural numbers ; calculate the sum of fourth power of first n odd natural numbers ; Driven Program
#include <bits/stdc++.h> NEW_LINE using namespace std ; long long int oddNumSum ( int n ) { return ( n * ( 2 * n + 1 ) * ( 24 * n * n * n - 12 * n * n - 14 * n + 7 ) ) / 15 ; } int main ( ) { int n = 4 ; cout << oddNumSum ( n ) << endl ; return 0 ; }