WAP IN C++To Accept a number and display the number of digits
Answers
Answered by
1
int num,n=0;
cout<<"Enter a number: ";
cin>>num;
while(num>0)
{
num=num/10;
n++;
}
cout<<"\n The number of digits are: "<<n;
getch();
}
Similar questions