print digits of a number in c
#include <stdio.h>
int printDigits(int n){
int digit;
if(n < 10){//caso base
digit = n;
printf("%d\n", digit);
}else{
digit = printDigits(n/10);
digit = printDigits(n%10);
}
return digit;
}
int main(){
int num = 3467678;
printDigits(num);
return 0;
}#include <stdio.h>
int main(){
int num = 1024;
while(num != 0){
int digit = num % 10;
num = num / 10;
printf("%d\n", digit);
}
return 0;
}
Also in C:
- pebble scripting Boolean expression
- string compare in c
- matplotlib pyplot legend location
- RuntimeError: You must setup() the GPIO channel first
- 4k stogram chave
- #pragma pack(1) in c
- get chunks of a mp4 in ffmpeg
- char to int c
- inurl:fiu.edu math faculty
- how to create random integers from a specific range in c language
- how to add to the end of a linked list
- passing 'const char *' to parameter of type 'char *' discards qualifiers
- c how to define a variable
- kadane's algorithm
- lldb set breakpoint function name
- semicolong after for() loop stackoverflow
- change no_turbo
- addition of two numbers in c
- arduino knn
- convert string to uppercase in c
- c bool
- bootsrap textbox
- modulation
- how to pass an array to a thread in c?