Write a program to input the value of x and n & find and print sum of the follow

Write a program to input the value of x and n & find and print sum of the following series,
1 + x¹+ x²+ x³+x?+……….. +x^n