Advertisement
Kl43z

division entera recursiva

Nov 6th, 2014
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.36 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int dov(int x,int y);
  4.  
  5. int main(){
  6.     int input,divs;
  7.     printf ("Ingrese un número para calcular su division entera: \n");
  8.     scanf ("%d", &input);
  9.     printf ("Ingrese el divisor:\n");
  10.     scanf ("%d", &divs);
  11.     printf ("La division es %d\n", dov(input,divs));
  12.  
  13. }
  14.  
  15. int dov(int x,int y){
  16.     if ((x-y)<0) return 0;
  17.     else return dov(x-y,y)+1;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement