/** calculate the value of 'a' raised to 'b'.**/
#include <stdio.h>
int main (){
int a,b,calc,calculation;
printf("Enter value of a and b\n");
scanf("%d %d",&a,&b);
calculation=1;
for(calc=1;calc<=b;calc++)
{
calculation=calculation*a;
}
printf("%d raised to %d is %d",a,b,calculation);
return 0;
}
My problem is I don't understand how this part " calculation=calculation*a; "
Let's say a=2, b=3; in for loop it will loop for 3 times rite?, but after that i don't know how it calculates to get the result. Just want to get some explanation because there is no explanation in the book about how it works.Thanks.