Sum of pairwise products | Simple JavaScript program to find sum of given series . ; Driver Code
function findSum ( n ) { let sum = 0 ; for ( let i = 1 ; i <= n ; i ++ ) for ( let j = i ; j <= n ; j ++ ) sum = sum + i * j ; return sum ; } let n = 5 ; document . write ( findSum ( n ) ) ;