[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/roydevashish/cpp/main/F20RecursionAssignment/GeometricSum.cpp [Back]  [Original]

/*
Title: Geometric Sum

Problem statement
Given k, find the geometric sum i.e.
1 + 1/2 + 1/4 + 1/8 + ... + 1/(2^k)
Note: using recursion.

Detailed explanation ( Input/output format, Notes, Images )
Input format :
Integer k

Output format :
Geometric sum (upto 5 decimal places)

Constraints :
0  k;
    cout 

Web Proxy Viewer  |  New URL  |  Original Page