.Write an algorithm to read two integers a and b and then compute a to the power b.
Answers
Answered by
1
Answer:
1. Take the integers as input from user.
2. If the language is python
- a. take the 2 numbers as input and store them. in variables a and b respectively
- b. print(a**b)
3. else if the language is any other
- a. initialize a variable=1 to store the product.
- b. run a loop with b number of cycles
- c. prod <-- prod * a
- d. end loop
- e. print prod.
Similar questions