0
Algorithm a to power b by while?
4 Answers
+ 4
Isn't a**b working?
You could do it with while
while(a<a**b){
a++;
}
cout << a;
(Idk if this will work)
(I see you started C++ course, so I suppose you want the answer in C++)
+ 6
In what language?
+ 1
what language are you using?
If you're using python:
i=0
num=a
while i<b:
a*=num
i+=1
If you're using c++:
int i=1;
int num=a;
while(i<b){
a*=num;
i+=1;
}
+ 1
c++
thank you