/*------------------------------------------------------------------*/ /* powerunsignedflat.c */ /* Author: Bob Dondero */ /*------------------------------------------------------------------*/ #include static unsigned int uiBase; static unsigned int uiExp; static unsigned int uiPower = 1; static unsigned int uiIndex; int main(int argc, char *argv[]) /* Read a non-negative base and exponent from stdin. Write base raised to the exponent power to stdout. */ { printf("Enter the base: "); scanf("%u", &uiBase); printf("Enter the exponent: "); scanf("%u", &uiExp); uiIndex = 1; loop1: if (uiIndex > uiExp) goto loopend1; uiPower *= uiBase; uiIndex++; goto loop1; loopend1: printf("%u to the %u power is %u.\n", uiBase, uiExp, uiPower); return 0; }