#include<stdio.h>
int main()
{
int m, n, i,p=1;
printf("Enter the number and its power (exponent)\n");
scanf("%d%d",&m,&n);
for( i = 0 ; i < n ; i++ )
p*=m;
printf("%d raised to %d is: %d",m,n,p);
}
Search This Blog
Showing posts with label exponent c program. Show all posts
Showing posts with label exponent c program. Show all posts
Program to Find Power of a Number
This is a c program to calculate power of a given number. The inputs are the number and its exponent (power). For example, if you give m and n, the result is m^n.
Subscribe to:
Posts (Atom)