Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
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
Fallo matriz
printf
Multiple If statements v1
mod 4
MyWall1
asasas
B_141121_aleatorios
Area of a rectangular prism
Midterm practice 2
Jai