(1374 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.

2 UpvotesUpvote |
1 DownvotesDownvote |

- Top Project Management Platforms Every Business Team should Know - Slack, Zoho, Teamwork Projects [1894 Views]
- Debug Javascript in Iphone or IPad iOS [3968 Views]
- Import Data from Spreadsheet to any Database in C# [1490 Views]
- Add a column with a default value to a table in Oracle SQL [1064 Views]
- Algorithm and Flowchart for Matrix addition [6202 Views]

- How To Win Ludo King Game Every Time [31970 Views]
- Algorithm to find whether number is Armstrong Number or Not [30442 Views]
- Knuth-Morris-Pratt (KMP) Substring Search Algorithm with Java Example [24942 Views]
- Jio Phone hang on LOGO problem Solution - Hard Reset Jio Phone [21834 Views]
- FlowChart and Algorithm to find Whether a Number is Even or Odd [16282 Views]