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...
Top Software Developer Intern Interview Questions Asked at Microsoft Corporation
Q. What were your responsibilities during your internship?
Q. What is the difference between polymorphism and inheritance?
Q. Given a string, reverse the order of characters using standard data structures a...read more
Interview Questions Asked to Software Developer Intern at Other Companies
Top Skill-Based Questions for Microsoft Corporation Software Developer Intern
C++ Interview Questions and Answers
300 Questions
Algorithms Interview Questions and Answers
250 Questions
Data Structures Interview Questions and Answers
250 Questions
Web Development Interview Questions and Answers
250 Questions
Operating Systems Interview Questions and Answers
250 Questions
System Design Interview Questions and Answers
250 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

