Nth Term of Geometric Progression (GP) Series
Determine the Nth term of a geometric progression (GP) series given the first term, common ratio, and the term number.
Explanation:
The general form of a GP series is defined by: A, A*R, A*(R^2), A*(R^3), ..., where A is the first term and R is the common ratio.
Input:
T
N A R
...
Output:
Nth term (modulo 10^9 + 7)
...
Example:
Input:
2
3 2 5
4 3 2
Output:
50
24
Constraints:
- 1 <= T <= 10
- 1 <= N <= 10^8
- 0 <= A <= 50
- 0 <= R <= 100
Time Limit: 1 second
Note:
Your task is to implement the function, and the output handling is already managed.

AnswerBot
4mo
Calculate the Nth term of a geometric progression series given the first term, common ratio, and term number.
Use the formula for the Nth term of a GP series: A * (R^(N-1))
Ensure to take the modulo 10^...read more
Help your peers!
Add answer anonymously...
Microsoft Corporation Software Developer Intern interview questions & answers
A Software Developer Intern was asked 7mo agoQ. What were your responsibilities during your internship?
A Software Developer Intern was asked 7mo agoQ. What is the difference between polymorphism and inheritance?
A Software Developer Intern was asked 9mo agoQ. Given a string, reverse the order of characters using standard data structures a...read more
Popular interview questions of Software Developer Intern
A Software Developer Intern was asked 6mo agoQ1. What were your responsibilities during your internship?
A Software Developer Intern was asked 6mo agoQ2. What is the difference between polymorphism and inheritance?
A Software Developer Intern was asked 8mo agoQ3. Given a string, reverse the order of characters using standard data structures a...read more
>
Microsoft Corporation Software Developer Intern Interview Questions
Stay ahead in your career. Get AmbitionBox app


Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+
Reviews
10L+
Interviews
4 Cr+
Salaries
1.5 Cr+
Users
Contribute to help millions
AmbitionBox Awards
Get AmbitionBox app

