Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
Pregunta de función cantidad de digitos
#include <stdio.h> #include <stdlib.h> // prototipo int calcularCantDigitos(long long); int main(void) { long long numero; // Entrada scanf("%lld", &numero); // Proceso int cantDigitos = calcularCantDigitos(numero); // Salida printf("%lld tiene %d digitos", numero, cantDigitos); return 0; } // definición de la función int calcularCantDigitos(long long num) { // Pre-condición if ( abs(num) < 10) return 1; int contador = 0; while (num != 0) { contador ++; num /= 10; } return contador; }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
NO OF NODES IN LINK LIST
Majeur ou mineur
Card shuffling and dealing program using structures
Présentation
Daniel - hw3q2
MULTI-CAST
My first 2D array
lab pro v.05
MATRICES TRIANGULARES
final advice
stackse - search stackoverflow differently
Please log in to post a comment.