Answers for "number of digits in int c++"

C++
0

number of digits in int c++

int length = 1;
int x = 234567545;
while ( x /= 10 )
   length++;
Posted by: Guest on July-14-2021
-2

c++ get digits of integer

int iNums = 12345;
int iNumsSize = 5;
for (int i=iNumsSize-1; i>=0; i--) {
    int y = pow(10, i);
    int z = iNums/y;
    int x2 = iNums / (y * 10);
    printf("%d-",z - x2*10 );
}
Posted by: Guest on July-22-2020

Code answers related to "number of digits in int c++"

Browse Popular Code Answers by Language