#include <stdio.h>
int mypower(int base, int exponent);
int x, y, result = 0;
int main()
{
result = mypower(x, y);
printf("%d raised to the power of %d is %d", x
, y
, result
); return 0;
}
int mypower(int base, int exponent)
{
int count = 1;
int total = base;
while (count < exponent)
{
total = base * total;
count++;
}
return total;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbXlwb3dlcihpbnQgYmFzZSwgaW50IGV4cG9uZW50KTsKaW50IHgsIHksIHJlc3VsdCA9IDA7CgppbnQgbWFpbigpCnsKICAgIHNjYW5mKCIlZCIsICZ4KTsKICAgIHNjYW5mKCIlZCIsICZ5KTsKICAgIHJlc3VsdCA9IG15cG93ZXIoeCwgeSk7CiAgICBwcmludGYoIiVkIHJhaXNlZCB0byB0aGUgcG93ZXIgb2YgJWQgaXMgJWQiLCB4LCB5LCByZXN1bHQpOwpyZXR1cm4gMDsKfQoKaW50IG15cG93ZXIoaW50IGJhc2UsIGludCBleHBvbmVudCkKewogICAgaW50IGNvdW50ID0gMTsKICAgIGludCB0b3RhbCA9IGJhc2U7CiAgICB3aGlsZSAoY291bnQgPCBleHBvbmVudCkKICAgIHsKICAgICAgICB0b3RhbCA9IGJhc2UgKiB0b3RhbDsKICAgICAgICBjb3VudCsrOwogICAgfQogICAgcmV0dXJuIHRvdGFsOwp9Cg==