Flowchart and Algorithm for calculating X to the Power of Y i.e XY

[24804 views]



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

Flowchart for calculating X to the Power of Y i.e XY :

Flowchart and Algorithm for calculating X to the Power of Y

Remove WaterMark from Above Flowchart

Algorithm for calculating X to the Power of Y i.e XY :

Step 1: Start Step 2: Declare variable pow and i. Step 3: Initialize pow= 1 and i= 1. Step 4: Read base X and power Y from user. Step 5: Repeat step until i is less than equal to Y i.e i<=Y 5.1: Set, pow= pow * x 5.2: Increment the value of i by 1 Step 6: The value stored in pow is the required value. Step 7: Stop

In the above algorithm,

  1. We first define variable pow and i and Initialize pow= 1 and i= 1.
  2. Then we read the base value and power value, then a loop is started until i reaches the value of Y.
  3. 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.
  4. Then, we return value stored in pow.
        



Having Difficulty understanding above Algorithm and Flowchart? Buy my Personal Notes



Want a custom Algorithm and Flowchart as per your requirement?"

Email your requirements at atechdailyweb@gmail.com


Are You Good enough in Algorithms? Prove it!



Comments

1 comment
  • kauko onkamo

    very nice explanation



Search

Our Website is viewed by more than 400K Technical Enthusiasts every month.
For Sponsored Advertisement OR Guest Posts, Contact us at atechdailyweb@gmail.com




Facing Programming Errors. Get Answers within 24 hours:


Ebook Download
Quiz For You:
Online Games
Play 2048 Game Online and Relax.
Play 2048 Game Online

Search Tags

    x to power of y algorithm

    x to power of y flowchart

    Pseudocode for calculating X to the Power of Y