(334 Views)

In this article, we will write an algorithm and flowchart for calculating X to the power of Y.

In the above algorithm,

- We first define variable pow and i and Initialize pow= 1 and i= 1.
- Then we read the base value and power value, then a loop is started until i reaches the value of Y.
- Inside the loop a variable pow is used to store the power value by reccursively multiplying the base value with pow, and then value of i is incremented.
- Then, we return value stored in pow.

0 UpvotesUpvote |
0 DownvotesDownvote |

- Difference between Join And Union in SQL [5758 Views]
- How to send a Header data through HTTP Request using curl [534 Views]
- Prime Number program in Python [722 Views]
- How To Reset Autoincrement value of Column in MySQL [1736 Views]
- Redirect port 80 to some another port using iptables on CentOS [598 Views]

- Knuth-Morris-Pratt (KMP) Substring Search Algorithm with Java Example [22806 Views]
- How To Win Ludo King Game Every Time [20364 Views]
- Algorithm to find whether number is Armstrong Number or Not [19988 Views]
- error: Multiple commands produce error in Xcode 10 [11712 Views]
- Jio Phone hang on LOGO problem Solution - Hard Reset Jio Phone [11194 Views]