Answers for "count no of digits in a number in c"

5

print digits of a number in c

#include <stdio.h>

int main(){
    int num = 1024;

    while(num != 0){
        int digit = num % 10;
        num = num / 10;
        printf("%d\n", digit);
    }
  
    return 0;
}
Posted by: Guest on July-08-2020
2

C number of digits in integer

int numberOfDigits = 1 + log10(number) // stores number of digits in integer
Posted by: Guest on January-07-2022

Code answers related to "count no of digits in a number in c"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language