//Downloaded From theonlinetutorials.com
//(C)2011.All rights reserved.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int x=0,n;
cout<<"Enter the number :";
cin>>n;
while(n>0)
{
n=n/10;
x=x+1;
}
cout<<"The no of digits are :"<<x;
getch();
}
Not Satisfied ? Just search & get the result
Related posts:
- C++ Program – No of Digits
- Sample – Program to convert 2-digit octal number into binary number and print it.
- Sample – Program to count the number of words and characters in a sentence.
- C++ class program – perform rational number arithmetic
- C++ program – calculate the factorial of a number using recursion.
