Power of Given Number

Power of Given Number

   #include<stdio.h>
   int main()
   {
       int pow,num,i=1;
       long int sum=1;
       printf("Enter a number: ");
       scanf("%d",&num);
       printf("\nEnter power: ");
       scanf("%d",&pow);
       while(i<=pow)
       {
         sum=sum*num;
         i++;
       }
     printf("\n%d to the power %d is: %ld",num,pow,sum);
     return 0;
   }

Share this

Related Posts

Dear User,

Thank you for your comment. Hope you like this blog. Kindly share us on Social Media so others can be updated.

-Chief Administrative Officer.