potencia recursiva
C
/*Escribir una función recursiva que calcule x^y mediante multiplicaciones
sucesivas, siendo x e y dos números enteros. */
int potencia(int x, int y){
int res = x;
if(y == 0){ //caso base
res = 1;
}else if(y == 1){
res = x;
}else{
res = res * potencia(x, y - 1);
}
printf("potencia: %d\n", res);
return res;
}
Also in C:
- Title
- how to print a file c
- Category
- C
- Title
- oop244
- Category
- C
- Title
- time now c
- Category
- C
- Title
- read a binary file c
- Category
- C
- Title
- what is strikethrough in markdown
- Category
- C
- Title
- how to make a linked list in c
- Category
- C
- Title
- how to open chrome using cmd
- Category
- C
- Title
- how to get random numbers in c
- Category
- C
- Title
- c printf uint32_t
- Category
- C
- Title
- Declaring Variables in C
- Category
- C
- Title
- c fill 2d array
- Category
- C
- Title
- passing 2d array as parameter to function in c
- Category
- C
- Title
- sum of arrays
- Category
- C
- Title
- what is conio.h
- Category
- C
- Title
- command line arguments c
- Category
- C
- Title
- how to pass an array value to a pthread in c
- Category
- C
- Title
- tkinter create_line
- Category
- C
- Title
- what is x:Name Xamarin forms
- Category
- C
- Title
- what are the causes of memory leaks in c
- Category
- C
- Title
- how to pass an array to a thread in c?
- Category
- C
- Title
- piramide
- Category
- C
- Title
- what is the meaningof noremap
- Category
- C
- Title
- ModuleNotFoundError: No module named 'easydict'
- Category
- C
- Title
- '&&' within '||'
- Category
- C
- Title
- disable gnu++11 option
- Category
- C
- Title
- c defined value sum
- Category
- C
- Title
- strcat in c
- Category
- C
- Title
- slurm array job
- Category
- C
- Title
- select all file from date powershell
- Category
- C
- Title
- how to change the mapping from jkil to wasd in vim
- Category
- C
- Title
- generate all permutations of string
- Category
- C
- Title
- c vs python
- Category
- C
- Title
- reset c array to zero
- Category
- C
- Title
- excel cell blank or zero
- Category
- C
- Title
- how to download file in powershell
- Category
- C
- Title
- remove an element from a set
- Category
- C
- Title
- stack implementation
- Category
- C
- Title
- insertion sort
- Category
- C
- Title
- code wars responsable drinker
- Category
- C
- Title
- powershell search big files
- Category
- C
- Title
- isalpha c
- Category
- C
- Title
- windowns 10 allow ping
- Category
- C
- Title
- delete docker image repository none
- Category
- C
- Title
- c
- Category
- C
- Title
- networkx remove attributes
- Category
- C
- Title
- program using if statement in c whether numnber is less eqaul to greater than 50
- Category
- C
- Title
- diagonales
- Category
- C
- Title
- change no_turbo
- Category
- C
- Title
- es fibo
- Category
- C
- Title
- simpy process return value
- Category
- C
- Title
- print integer to stdout using write or putchar?
- Category
- C
- Title
- primo
- Category
- C
- Title
- lazer codechef
- Category
- C
- Title
- how to write function in c
- Category
- C
- Title
- arduino define
- Category
- C
- Title
- tmux how to kill all sessions
- Category
- C
- Title
- c bitwise operators
- Category
- C
- Title
- scanf read line
- Category
- C
- Title
- C why is is & nit used in scan f fr string
- Category
- C
- Title
- ImportError: No module named 'skimage'
- Category
- C
- Title
- code: 'EADDRINUSE', [0] errno: 'EADDRINUSE', [0] syscall: 'listen', [0] address: '::', [0] port: 5000
- Category
- C
- Title
- csrf_exempt
- Category
- C
- Title
- write a binary file c
- Category
- C
- Title
- factors using recursion
- Category
- C
- Title
- mangoosejs
- Category
- C
- Title
- hentai clochette
- Category
- C
- Title
- pangram program in c
- Category
- C
- Title
- pi in c language
- Category
- C
- Title
- how to check the size of a file in linux c
- Category
- C
- Title
- string to int c
- Category
- C
- Title
- c concatenate strings
- Category
- C
- Title
- c copy string
- Category
- C
- Title
- write a program to ask the user 8 integer numbers. your program will then move all negative elements of your array to the end of the array without changing the order of positive elements and negative elements
- Category
- C
- Title
- how to rebasde
- Category
- C
- Title
- hostbuilder add environment variables
- Category
- C
- Title
- can we write a program without main in c
- Category
- C
- Title
- arduino digital input pins
- Category
- C
- Title
- how to use ? in c
- Category
- C
- Title
- remove element queue
- Category
- C
- Title
- entete c/c++
- Category
- C
- Title
- assert() in c
- Category
- C
- Title
- error: ‘cout’ was not declared in this scope
- Category
- C
- Title
- c array
- Category
- C
- Title
- Difference between ** and *
- Category
- C
- Title
- reverse function in c
- Category
- C
- Title
- d3 box shadow
- Category
- C
- Title
- xmlns='' was not expected
- Category
- C
- Title
- Couldn't create temporary file to work with
- Category
- C
- Title
- how to remove \n from a string c
- Category
- C
- Title
- variadic function in c
- Category
- C
- Title
- print variable c
- Category
- C
- Title
- chat c socket tcp geeksforgeeks
- Category
- C
- Title
- duplicar cadena
- Category
- C
- Title
- vbl share price
- Category
- C
- Title
- xamarin command listview button
- Category
- C
- Title
- pointer parameter where to put the asterix in C?
- Category
- C
- Title
- c how to define a variable
- Category
- C
- Title
- chat
- Category
- C
- Title
- how to print in c
- Category
- C
- Title
- putting value of struct in runtme
- Category
- C