Search This Blog

Translate

c program to find power of a number using recursion

write a c program to find factorial of a number using recursion,c program to find prime factors of a number using recursion,c program to find sum of digits of a number using recursion,c program to calculate factorial of a number using recursion,c program to reverse a number using recursion,c program to find factorial using recursion func


c program to find power of a number using recursion

recursive function to find power of number c program


#include "stdio.h"
#include "conio.h"
float power(float,int);
void main()
{
 int p;
 float b,pow=0.0;

 clrscr();
 printf("Enter the base &power :");
 scanf("%f,%d",&b,&p);
 pow=power(b,p);
 printf("%f",pow);
 getch();
}
float power(float b,int p)
{
 if(p==0)
  return 1;
 else
  return(b*power(b,p-1));

}




write a c program to find factorial of a number using recursion,c program to find prime factors of a number using recursion,c program to find sum of digits of a number using recursion,c program to calculate factorial of a number using recursion,c program to reverse a number using recursion,c program to find factorial using recursion func

C Program example List

Google+ Badge