Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
Finding power using recursion
#include<stdio.h> float power(int,int); int main() { int x,y; printf("Enter two numbers\n"); scanf("%d%d",&x,&y); printf("%d to the power %d is %f",x,y,power(x,y)); return 0; } float power(int x, int y) { if(y==0) return 1; else if(y>0) return (x*power(x,y-1)); else return ((1/x)*power(x,y-1)); }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
poinres1
Str_ptr_arg
fibonacci2
PREGUNTA 3 FICHERO
Project 3 part 2 Book v10.2
In Class 1.23.17 Bit operations
bitwise operations
A_141212_IntercambiarValores
Linked List
Quadratic Formula
stackse - search stackoverflow differently
Please log in to post a comment.