Return to whome?? If we return to main() when b==1 then only 3 will go. Also after when b==1 and return a; is executed y not the third statement is not executed because their is only if part and not else. Im really confused , i will b thankfull if u could help me out.
best idea is given below #include int power(int n1 , int n2); int main() { int x, n,num; printf("Enter base number: "); scanf("%d", &x); printf("Enter Power number: "); scanf("%d", &n); num=power(x,n); printf(" %d^%d = %d", x, n,num ); return 0; } int power(int n1, int n2) { if(n2 == 0) return 1; return (n1*power(n1, n2-1)); }
Wonderful explanation
sir, can u please upload for fibonacci series.
Thanks sir...
hey man What type of Pen or Notebook you're USing Tell me
This video helped !!
Thanks
what a concept it is!
nice explanation
which notebook r u using?
Return to whome?? If we return to main() when b==1 then only 3 will go. Also after when b==1 and return a; is executed y not the third statement is not executed because their is only if part and not else. Im really confused , i will b thankfull if u could help me out.
Help ! how to solve ?
2. What does f(5) return? What does the function do?
int f(int n){
if(n
thanks
What notebook is that?
i also wanted to know?
it is not work for ZERO(0) power.
best idea is given below
#include
int power(int n1 , int n2);
int main()
{ int x, n,num;
printf("Enter base number: ");
scanf("%d", &x);
printf("Enter Power number: ");
scanf("%d", &n);
num=power(x,n);
printf("
%d^%d = %d", x, n,num );
return 0;
}
int power(int n1, int n2)
{ if(n2 == 0)
return 1;
return (n1*power(n1, n2-1));
}
It is not work for negative powers👎