Efficient solution to find sum of arithmetic series .
#include <bits/stdc++.h> NEW_LINE using namespace std ; float sumOfAP ( float a , float d , float n ) { float sum = ( n / 2 ) * ( 2 * a + ( n - 1 ) * d ) ; return sum ; }