C Program to find result of power of a number

#include<stdio.h>
int main( )
{
   int n, pow, i, j=1;

  printf("Enter the number and its power");

  scanf("%d %d",&n,&pow);

  if(pow==0)

     printf("Result is 1");

  for(i=1; i<=pow; i++)

    {
       j=j*n;
    }

  if(pow>0)

    printf("Result is %d",j);

return 0;


}



  

Post a Comment

0 Comments