New course! Every coder should learn Generative AI!
Try a free lesson0
Write a java program for calculating a^b input by the user?
3 Answers
+ 2
Math.pow(a,b);
+ 2
prod=1; for(int x=0; x<b; x++) prod*=a;
But it doesn't like floats
0
can't. we use loop in this?