/*--------------------------------------------------------------------*/ /* powerunsigned.c */ /* Author: Bob Dondero */ /*--------------------------------------------------------------------*/ #include static unsigned int uiBase; static unsigned int uiExp; static unsigned int uiPower = 1; static unsigned int uiIndex; int main(void) /* Read a non-negative base and exponent from stdin. Write base raised to the exponent power to stdout. Return 0. */ { printf("Enter the base: "); scanf("%u", &uiBase); printf("Enter the exponent: "); scanf("%u", &uiExp); for (uiIndex = 1; uiIndex <= uiExp; uiIndex++) uiPower *= uiBase; printf("%u to the %u power is %u.\n", uiBase, uiExp, uiPower); return 0; }