fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int n;
  5. printf("Enter the number: ");
  6. scanf("%d",&n);
  7. int count=0;
  8. while(n>0){
  9. n=n/10;
  10. count++;
  11. }
  12. printf("The number of digits are %d", count);
  13.  
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0.01s 5320KB
stdin
Standard input is empty
stdout
Enter the number: The number of digits are 0