Write program in C to make your own power function

 //make your own power function

#include <stdio.h>

int main()

{

int base, exp, result;

printf("Enter a base number: ");

scanf("%d", &base);

printf("Enter an exponent: ");

scanf("%d", &exp);


result = pow (base,exp);


printf("%d to the power of %d is=%d", base, exp, result);

return 0;

}

Comments

Popular posts from this blog

Automations and robotics

Palindrome Pattern Program In Java Language

Rhombus Pattern Program In Java Language