How to Make recursive function of Power and Exponential series in Turbo C


  • How to Make recursive function of Power and Exponential series in Turbo C

  • 1 Comment sorted by

  • #include
    #include
    int power(int base,int exp)
    {
    if(exp==1)
    {
    return(base);
    }
    else
    {
    return(base*power(base,exp-1));
    }
    }
    main()
    {
    int a,b,p;
    clrscr();
    printf("Enter the base:");
    scanf("%d",&a);
    printf("Enter the exp:");
    scanf("%d",&b);
    p=power(a,b);
    printf("%d",p);
    getche();
    }




Howdy, Stranger!

It looks like you're new here. If you want to get involved, or you want to Ask a new Question, Please Login or Create a new Account by Clicking below

Login with Facebook

Popular Posts of the Week

Optimum Creative