C Program to Find Power of a Number
Multiplying the base into exponent times gives you the value of power.
- //C program to find power
-
- #include<stdio.h>
-
- int main()
- {
- int b,expo;
- long long p = 1;
- int i;
-
- /* Input base and exponent from user */
- printf("Enter base: ");
- scanf("%d", &b);
- printf("Enter exponent: ");
- scanf("%d", &expo);
-
- /* Multiply base, exponent times*/
- for(i=1; i<=expo; i++)
- {
- p = p * b;
- }
-
- printf("%d ^ %d = %d", b, expo, p);
-
- return 0;
- }
Output

Solution not working or have any suggestions? Please send an email to [email protected]
Download Android App