Draw a flow chart for a program that 6 calculate the factorial of a number. Please note that factorial is defined as n! = n x (n —1) x (n — 2) x x 3 x 2 x 1.
Answers
Answered by
3
Answer:
Program to find the sum of the series 1 + x + x^2+ x^3+ .. + x^n
Given an integer X, the task is to print the series and find the sum of the series
1 + x^{1} + x^{2} + x^{3} + x^{4} ... x^{N}
Examples :
Input: X = 2, N = 5
Output: Sum = 31
1 2 4 8 16
Input: X = 1, N = 10
Output: Sum = 10
1 1 1 1 1 1 1 1 1 1
Similar questions