← All problemsSign in

The Last Digit

Tom is doing his math class work from three days but he is tired of making operations a lot. He must deliver his task tomorrow. His math’s teacher gives him two numbers a and b. The problem consist of finding the last digit of the a raised to the power b. Help Tom with his problem. You are given two natural numbers: The base a and the index b , a and b both are not 0. You have to find the last

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start