C Program to Count number of digits in number without using mod Operator
Learn C - C tutorial - c program to count number of digits in number without using mod operator - C examples - C programs
C Program to Count number of digits in number without using mod Operator
- By using this C Program convert a decimal number into binary & count the number of 1s.
- The program uses module operation and multiplication with base 2 operation for conversion.
- It also uses modulo operation to check for 1’s and accordingly increments the count of 1s.
- Here is source code of the C program to convert a decimal number to binary & count the number of 1s.