Write a program to calculate one number raised to the power other number using while and do while. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Write a program to calculate one number raised to the power other number using while and do while.

18th Jan 2021, 2:45 PM
Shreya Singh
Shreya Singh - avatar
3 Answers
+ 2
Please tag 'C-language' rather than 'usingc', the latter didn't come as clear about language context. Share your code in progress so others can see where the problem is. Follow the below guide in case you didn't know how 👇 https://www.sololearn.com/post/75089/?ref=app
18th Jan 2021, 3:25 PM
Ipang
+ 2
Pls share your attempt if it is unsolved. Complete loops lesson. num1 = num1*num1; run this in loop num2 times just. Then you get num1 to the power raised num2 times. I think, Tags " c loop power " will help more for search bar.
18th Jan 2021, 6:45 PM
Jayakrishna 🇮🇳
+ 1
Thank you for updating the tags 🙏 Here's a bit of pseudo Begin Function power( n, x ) returns int Let ret = n While --x not equal zero Begin Multiply ret by n End Return ret End Function
18th Jan 2021, 5:28 PM
Ipang