Computer Science, asked by sambitbhanjadeo, 1 year ago

WAP IN C++To Accept a number and display the number of digits

Answers

Answered by siddhartharao77
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