• Courses
  • Tutorials
  • DSA
  • Data Science
  • Web Tech
June 13, 2022 |5.5K Views

Power without using multiplication(*) and division(/) operators

Description
Discussion

Method 1 (Using Nested Loops)


We can calculate power by using repeated addition. 


For example to calculate 5^6. 


1) First 5 times add 5, we get 25. (5^2) 
2) Then 5 times add 25, we get 125. (5^3) 
3) Then 5 times add 125, we get 625 (5^4) 
4) Then 5 times add 625, we get 3125 (5^5) 
5) Then 5 times add 3125, we get 15625 (5^6)

Power without using multiplication() and division() operators   : https://www.geeksforgeeks.org/write-you-own-power-without-using-multiplication-and-division/