mostrar lista recursiva
C
/* Construir una función recursiva que imprima la lista de números naturales
comprendidos entre dos valores a y b dados por el usuario. */
void lista(int a, int b){
if(a == b){
printf("%d", a);
}else if(a < b){
printf("%d ", a);
printf("%d ", b);
if (a + 1 != b){
lista(a + 1, b - 1);
}
}
else if(b < a){
printf("%d ", a);
printf("%d ", b);
if (b + 1 != a){
lista(a - 1, b + 1);
}
}
}
Also in C:
- Title
- what is strikethrough in markdown
- Category
- C
- Title
- c print hello world
- Category
- C
- Title
- atoi
- Category
- C
- Title
- #include<stdlib.h>
- Category
- C
- Title
- functions return type in c
- Category
- C
- Title
- How to pull images from Docker Registry
- Category
- C
- Title
- how to free a 2d array correctly
- Category
- C
- Title
- read a binary file c
- Category
- C
- Title
- c printf right pad with space
- Category
- C
- Title
- xamarin command listview button
- Category
- C
- Title
- c list
- Category
- C
- Title
- how to print the address of a pointer in c
- Category
- C
- Title
- code wars responsable drinker
- Category
- C
- Title
- how to find the ith row of pascal's triangle in c
- Category
- C
- Title
- buscar caracter
- Category
- C
- Title
- how to do matrix multiplication in c
- Category
- C
- Title
- c bit access union
- Category
- C
- Title
- california
- Category
- C
- Title
- get_session` is not available when using TensorFlow 2.0.
- Category
- C
- Title
- strtoul C
- Category
- C
- Title
- hello world
- Category
- C
- Title
- c defined value sum
- Category
- C
- Title
- c copy string
- Category
- C
- Title
- vbl share price
- Category
- C
- Title
- what are the causes of memory leaks in c
- Category
- C
- Title
- program using if statement in c whether numnber is less eqaul to greater than 50
- 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
- find string in all files powershell
- Category
- C
- Title
- how to open a website in c
- Category
- C
- Title
- passing 2d array as parameter to function in c
- Category
- C
- Title
- how to open chrome using cmd
- Category
- C
- Title
- classification report to excel
- Category
- C
- Title
- wait function in c
- Category
- C
- Title
- declare integer c
- Category
- C
- Title
- how to get user input in c
- Category
- C
- Title
- c check if char is number
- Category
- C
- Title
- how to sleep in c
- Category
- C
- Title
- read files in c
- Category
- C
- Title
- tkinter create_line
- Category
- C
- Title
- how to ascii art in c
- Category
- C
- Title
- piramide
- Category
- C
- Title
- switch case c
- Category
- C
- Title
- c how to define a variable
- Category
- C
- Title
- fa fa-facebook
- Category
- C
- Title
- c check if file was created
- Category
- C
- Title
- delete docker image repository none
- Category
- C
- Title
- sbatch array set max jobs at once
- Category
- C
- Title
- Switch Mode C Programming
- Category
- C
- Title
- c program to perform transpose of a matrix
- Category
- C
- Title
- write array of char to file in c
- Category
- C
- Title
- command line arguments c
- Category
- C
- Title
- enum c
- Category
- C
- Title
- remove an element from a set
- Category
- C
- Title
- xmlns='' was not expected
- Category
- C
- Title
- es palindromo
- Category
- C
- Title
- how to put quotes inside string c
- Category
- C
- Title
- div
- Category
- C
- Title
- remove element queue
- Category
- C
- Title
- duplicar cadena
- Category
- C
- Title
- objective c swizzle method
- Category
- C
- Title
- /usr/bin/mandb: fopen /var/cache/man/7935: Permission denied
- Category
- C
- Title
- how to convert int in to const char in c
- Category
- C
- Title
- multiplication in c
- Category
- C
- Title
- C largest unsigned int
- Category
- C
- Title
- arduino vscode upload choosing sketch
- Category
- C
- Title
- diferencia entre * y & en c
- Category
- C
- Title
- how to get random numbers in c
- Category
- C
- Title
- scanf read line
- Category
- C
- Title
- vbnet create and write on file
- Category
- C
- Title
- c substring
- Category
- C
- Title
- how to go to top of file in vim
- Category
- C
- Title
- uninstall elgg from hostgtor
- Category
- C
- Title
- c print array
- Category
- C
- Title
- c value set to zero __memmove_avx_unaligned_erms
- Category
- C
- Title
- múltiplos entre dos numeros en c
- Category
- C
- Title
- random en c
- Category
- C
- Title
- how to make a linked list in c
- Category
- C
- Title
- update ubuntu in terminal
- Category
- C
- Title
- too few arguments to function in c
- Category
- C
- Title
- printf n characters c
- Category
- C
- Title
- potencia recursiva
- Category
- C
- Title
- left me on read
- Category
- C
- Title
- root in C
- Category
- C
- Title
- how can i remove a specific item from an array
- Category
- C
- Title
- get configuration script window 7
- Category
- C
- Title
- entete c/c++
- Category
- C
- Title
- docker images command
- Category
- C
- Title
- long commands makes terminal lag after modifying PS1
- Category
- C
- Title
- docker pull command
- Category
- C
- Title
- arduino knn
- Category
- C
- Title
- c check if char is an operator
- Category
- C
- Title
- es fibo
- Category
- C
- Title
- latex font sizes
- Category
- C
- Title
- array length c
- Category
- C
- Title
- what is size_t in c
- Category
- C
- Title
- reverse function in c
- Category
- C
- Title
- limit of integer in c
- Category
- C
- Title
- reset c array to zero
- Category
- C
- Title
- error: ‘cout’ was not declared in this scope
- Category
- C
- Title
- how to comment in arduino
- Category
- C