C Program to display the No. of Digits in an Entered Number

This program displays the number of digits present in the number that is entered through the input.
#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();
}
Popularity: 1% [?]
Visitors who read this post, also read:
By using/following this site you agree to our Legal Disclaimer



Leave your response!