Power

#include
int pw(int j, int n){
    int power,i;
    power=1;
    for(i=1;i<=n;i++)
       power*=j;
    return power;
}
int main (void)
{
    int a,b;
    printf("Enter two non-negative number:\n");
    scanf("%d%d",&a,&b);
    printf("%d",pw(a,b));
    system("pause");
    return 0;
}

0 comments:

Post a Comment