Problem 2396. last n digit of a power function
Calculate the power of a given a base, exponent. Return the last n digit number.
Example 1: base = 3; expo = 8; n = 3; 3^8 = 6561 return the last 3 digit number 561.
Example 2: base = 3; expo = 10; n = 3; 3^10 = 59049 return the last 3 digit number 49.
- base, exponent and n are natural numbers
Solution Stats
Problem Comments
-
1 Comment
Jihye Sofia Seo
on 12 Feb 2017
I think the third test case is wrong. Anyone else has problem??
Solution Comments
Show commentsProblem Recent Solvers25
Suggested Problems
-
8985 Solvers
-
Find the peak 3n+1 sequence value
2528 Solvers
-
Replace NaNs with the number that appears to its left in the row.
3017 Solvers
-
Determine Whether an array is empty
785 Solvers
-
Find the maximum number of decimal places in a set of numbers
3026 Solvers
More from this Author6
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!