division recursiva
// 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:
- c calloc
- fgets langage c
- sleep in c programming
- resto de division recursiva
- partia e vjosa osmanit
- double return type in c
- vs code turn off formatter
- celsius to fahrenheit formula
- c concatenate and allocate string
- arduino c string split by delimiter
- program using if statement in c whether numnber is less eqaul to greater than 50
- online python to c converter
- typedef in c
- how to check where the last char is in a string c
- multiplication in c
- why do you jerk while falling aslee
- atoi c
- c interview questions for experienced
- matrix c declaration
- With a suitable example, explain increment, decrement and compound assignment operators
- string compare in c
- what is x:Name Xamarin forms
- Exception caught by image resource service
- declare character array statically?