resto de division recursiva
C
// devuelve el reseto de la division entera entre dividendo y divisor
// no se puede usar el operadoro % ni cocientini
int resto(int dividendo, int divisor){
int res;
if(dividendo < divisor){ //caso base
res = dividendo;
}else{
res = resto(dividendo - divisor, divisor);
}
return res;
} // devuelve el cociente de la division entera entre dividendo y divisor
// (no se puede usar el operador cociente)
int cociente(int dividendo, int divisor){
int res = 1;
if(dividendo - divisor < 0){//caso base 1
res = 0;
}else if( dividendo - divisor == 0){//caso base 2
res = 1;
}else{
res = res + cociente(dividendo - divisor, divisor);
}
return res;
}
Also in C:
- Title
- es fibo
- Category
- C
- Title
- random en c
- Category
- C
- Title
- c concatenate strings
- Category
- C
- Title
- command line coursera
- Category
- C
- Title
- how to change the mapping from jkil to wasd in vim
- Category
- C
- Title
- arduino define
- Category
- C
- Title
- how to make a linked list in c
- Category
- C
- Title
- generate all permutations of string
- Category
- C
- Title
- string to int c
- Category
- C
- Title
- what is conio.h
- Category
- C
- Title
- accessing elements 2D array using pointers
- Category
- C
- Title
- powershell search big files
- Category
- C
- Title
- printf("%3d ",XX);
- Category
- C
- Title
- Declaring Variables in C
- Category
- C
- Title
- remove an element from a set
- Category
- C
- Title
- error: ‘istringstream’ is not a member of ‘std’
- Category
- C
- Title
- changing tuple values
- Category
- C
- Title
- sum of arrays
- Category
- C
- Title
- Gemfile.lock`. It is likely that you need to grant write permissions for that path.
- Category
- C
- Title
- strtoul C
- Category
- C
- Title
- 233 pounds to inr
- Category
- C
- Title
- networkx remove attributes
- Category
- C
- Title
- c allocate array
- Category
- C
- Title
- how to free memory in c
- Category
- C
- Title
- es vocal
- Category
- C
- Title
- lazer codechef
- Category
- C
- Title
- how to get random numbers in c
- Category
- C
- Title
- how to remove \n from a string c
- Category
- C
- Title
- strrev in c
- Category
- C
- Title
- factorial of a given number in c
- Category
- C
- Title
- can we write a program without main in c
- Category
- C
- Title
- accessing elements of 1d array using pointers
- Category
- C
- Title
- passing 'const char *' to parameter of type 'char *' discards qualifiers
- Category
- C
- Title
- error: ‘cout’ was not declared in this scope
- Category
- C
- Title
- maximo comun divisor
- Category
- C
- Title
- install postgres on linux
- Category
- C
- Title
- multiplication operator in c
- Category
- C
- Title
- c producer consumer pthread semaphore
- Category
- C
- Title
- print integer to stdout using write or putchar?
- Category
- C
- Title
- read from stdin c
- Category
- C
- Title
- how to check the size of a file in linux c
- Category
- C
- Title
- a enum data type in c with loop
- Category
- C
- Title
- how to declare 2 d array using malloc
- Category
- C
- Title
- c print array
- Category
- C
- Title
- boolean function c
- Category
- C
- Title
- c bit access union
- Category
- C
- Title
- How to pull images from Docker Registry
- Category
- C
- Title
- function pointer c
- Category
- C
- Title
- link whatsapp to website
- Category
- C
- Title
- get configuration script window 7
- Category
- C
- Title
- remove element queue
- Category
- C
- Title
- how to do Employing defensive code in the UI to ensure that the current frame is the most top level window
- Category
- C
- Title
- disable gnu++11 option
- Category
- C
- Title
- how to comment in arduino
- Category
- C
- Title
- entete
- Category
- C
- Title
- how to login to another user in powershell
- Category
- C
- Title
- measure time in c
- Category
- C
- Title
- how to pass an array value to a pthread in c
- Category
- C
- Title
- how can i remove a specific item from an array
- Category
- C
- Title
- fibonacci series using recursion
- Category
- C
- Title
- declaring a volatile in c
- Category
- C
- Title
- how to open chrome using cmd
- Category
- C
- Title
- root in C
- Category
- C
- Title
- arduino knn
- Category
- C
- Title
- atoi c
- Category
- C
- Title
- how to open a website in c
- Category
- C
- Title
- delete string function in c
- Category
- C
- Title
- infinite loop using while
- Category
- C
- Title
- strcat in c
- Category
- C
- Title
- C/c drop mime
- Category
- C
- Title
- hostbuilder add environment variables
- Category
- C
- Title
- lelcetric fied
- Category
- C
- Title
- pop and push shows black screen which needs to be pressed back flutter
- Category
- C
- Title
- sbatch array set max jobs at once
- Category
- C
- Title
- How to make a printf in c
- Category
- C
- Title
- c defined value sum
- Category
- C
- Title
- c string concatenation with int
- Category
- C
- Title
- c print hello world
- Category
- C
- Title
- ‘uint64_t’ was not declared in this scope
- Category
- C
- Title
- c get first n characters of string
- Category
- C
- Title
- ModuleNotFoundError: No module named 'easydict'
- Category
- C
- Title
- array length c
- Category
- C
- Title
- c bitwise operators
- Category
- C
- Title
- powershell list big files
- Category
- C
- Title
- malloc in c
- Category
- C
- Title
- functions return type in c
- Category
- C
- Title
- -> operator
- Category
- C
- Title
- change no_turbo
- Category
- C
- Title
- docker pull command
- Category
- C
- Title
- arduino millis()
- Category
- C
- Title
- write array of char to file in c
- Category
- C
- Title
- c array
- Category
- C
- Title
- windeployqt example
- Category
- C
- Title
- CL/cl.h: No such file or directory
- Category
- C
- Title
- how to check where the last char is in a string c
- Category
- C
- Title
- how to print in c
- Category
- C
- Title
- where is my vimrc
- Category
- C
- Title
- potencia recursiva
- Category
- C
- Title
- select all file from date powershell
- Category
- C
- Title
- qtableview get selected row
- Category
- C