Skip to main content

RETURN M TO THE POWER N USING RECURSION


LIST OF PROGRAMS


#include<stdio.h>
#include<conio.h>
void main()
{
int t(int m2,int n2);
int m,n;
clrscr();
printf("ENTER TWO NUMBERS\n");
scanf("%d%d",&m,&n);
printf("SOLUTION IS :\n");
printf("%d",t(m,n));
getch();
}
int  t(int m2,int n2)
{
if(n2<=0)
return(1);
else if(n2==1)
return(m2);
else
return(m2*t(m2,--n2));
}

Comments

Popular posts from this blog

unix commands