0

function code in c++

input an integer and in which function should return number of digits in that number!

2nd Dec 2016, 4:32 PM
Abrar Hussain
Abrar Hussain - avatar
1 Answer
+ 1
Void length(int n) { int t, l; while (n! =0) { t=n%10; n=n/10; l=l+1; } cout<<l; } This function will give you number of digits present in the entered number.
7th May 2017, 8:38 AM
surbhi
surbhi - avatar