C Program to count the number of digits in the entered number

This program displays the number of digits present in the number that is entered through the input.

#include<stdio.h>
#include<conio.h>

void main()

{
unsigned long int num;
int i=0;
clrscr();
printf(“Enter the digit\n”);
scanf(“%lu”,&num);
while(num!=0)
{
num=num/10;
++i;
}
printf(“Length=%d”,i);
getch();
}

People who read this also read:

  • No Related Posts
23 Comments
  1. November 12, 2010
  2. November 14, 2010
    • November 18, 2010
  3. November 18, 2010
    • November 18, 2010
  4. November 18, 2010
  5. November 24, 2010
    • November 24, 2010
  6. November 26, 2010
    • November 26, 2010
  7. December 7, 2010
    • December 7, 2010
  8. December 11, 2010
    • December 11, 2010
  9. December 11, 2010
    • December 12, 2010
  10. December 16, 2010
  11. January 2, 2011
    • January 4, 2011
  12. January 20, 2011
  13. January 21, 2011
  14. January 22, 2011
  15. November 14, 2012

Leave a Reply

Your email address will not be published. Required fields are marked *