Code Box
---------------------------------------------
/*Program to find length or numbers of digits in any number*/
#include<iostream.h>
#include<conio.h>
void main()
{
int num,len;
clrscr();
cout<<"\nEnter A Number :";
cin>>num;
for(len=0;num>=1;)
{
num=num/10;
len++;
}
cout<<"\nLength Number:"<<len;
getch();
}
/* Note: Due to the range of integer program does not work for more than 5 digits */
No comments:
Post a Comment