C,C++,Java,C#,.Net, Win32,Visual C++, Windows Programming & How To's.
Get All The Solutions.
Blog Archive
Sunday, August 29, 2010
Program for calculate a power b by recursion.
/* Program for calculate a power b by recursion. */ #include<conio.h> #include<stdio.h> int power(int,int); int main() { clrscr(); printf("%d",power(5,3)); } int power(int a,int b) { if(b>0) { return a*power(a,b-1); } else { return 1; }
No comments:
Post a Comment