In the first method, we used the property (a * b) % m = (a % m * b % m) % m to compute 3^32 mod 80 as follows:
3^32 % 80 = (3^16 % 80 * 3^16 % 80) % 80 = (10304 % 80 * 10304 % 80) % 80 = (24 * 24) % 80 = 576 % 80 = 16
In the second method, we used the fact that 3^2 = 9 mod 80 to rewrite 3^32 as (3^2)^16, and then used the property (a^b) % m = (a % m)^b % m to compute 3^32 mod 80 as follows:
3^32 % 80 = (3^2)^16 % 80 = (9^16) % 80 = (6561^8) % 80 = (2401^8) % 80 = (1^8) % 80 = 1 % 80 = 1
Both of these methods are valid and will give the correct result, which is 3^32 mod 80 = 16.
@gatecse correct me if i m wrong