/* 1.Write the sum of 1/(2^i) for i ranging from 0 to 2. 2.Later generalise it to i ranging from 0 to N where N is a user defined input. covered in task_5d code. 3.Challenge: Calculate 2^i without using pow function. */ #include //#include using namespace std; /*to do task: write the function that computes s^exp*/ double user_function (double s, int exp) { double result ; return result ; } int main( ) { int i =1 ; double s= 0.5 ;// declaration for (i=0 ; i<=2 ; ++i) { s = s + user_function(s, i) ; // for task 3. // s = s + pow (0.5s, ,i); // ( 0.0 + 0.5^0) i=0, s=1 //cout << " sum["<