503,711 views
16 votes
16 votes
This is computer programming and it confuses me very much

This is computer programming and it confuses me very much-example-1
User David Lee
by
3.0k points

1 Answer

16 votes
16 votes

Answer:

Using a loop or using the power function from a math library.

Step-by-step explanation:

Really the question needs a bit more context. But if you want to calculate
a^(b)

and b is a whole number, you could create a loop with b steps and keep multiplying by a.

Alternatively, you can use a power function such as pow(a,b) from math.h in the C programming language.

User Krunal Modi
by
3.1k points