This program displays the number of digits present in the number that is entered through the input.
#include<stdio.h>
#include<conio.h>
#include<conio.h>
void main()
{
unsigned long int num;
int i=0;
clrscr();
printf(“Enter the digitn”);
scanf(“%lu”,&num);
while(num!=0)
{
num=num/10;
++i;
}
printf(“Length=%d”,i);
getch();
}
unsigned long int num;
int i=0;
clrscr();
printf(“Enter the digitn”);
scanf(“%lu”,&num);
while(num!=0)
{
num=num/10;
++i;
}
printf(“Length=%d”,i);
getch();
}
0 comments:
Post a Comment