Hello! I'm new to instructables, and I wanted to share a small bit of code that allows you to solve for exponents in batch.
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
echo Positive Exponents
set /p num=
set /p power=
set /a "x=1"
set /a "ans=num"
if %num% EQU 0 goto :end
if %power% EQU 0 goto :end
set /a "ans=ans*num"
if %power% GTR 1 set /a "x=x+1"
if %x%==%power% goto :end
if %ans% LEQ 0 goto :end
if %ans% GTR 0 echo %num% ^^ %power% = %ans%
if %ans% LEQ 0 echo Error
That's it! If you can make use of this, feel free to change it as much as you like.
See you later!