int type maximum ten digits 2147483647
int m=1;
int n=1345;
for(m=1;m<=1000000000;m*=10)
{ int d=n/m%10; printf(“%d\n “,d); } will report an error overflow, because the maximum m is, and then execute 1000000000*10 to overflow
Improve
int m=1;
int n=1345;
for(m=1000000000;m>
=1;m/=10)
{ int d=n/m%10; printf(“%d\n”,d); } this Hour output from high output 1 3 4 5
Read More:
- Arithmetic overflow error converting identity to data type int
- Arithmetical overflow error converting expression to data type datetime
- make Error: error: cast from ‘int32_t*’ {aka ‘int*’} to ‘int’ loses precision [-fpermissive]
- How to print how to output Int64_ t,uint64_ The value of T in C
- How to Fix stack overflow error
- Arithmetic overflow error converting numeric to data type numeric.
- @How to solve eclipse error after setter and @ getter (@ data) annotation
- Solution pandas.errors.ParserError : Error tokenizing data. C error: Buffer overflow caught
- Python: How to Fix “Ord() expected string of length 1, but int found”
- How to Fix Sklearn ValueError: This solver needs samples of at least 2 classes in the data, but the data
- Develop a Boolean equation for overflow detection
- Oci-22053: overflow error problem
- How to Solve Infinite scroll the pit encountered
- The C language qsort() function reports an error for overflow of – 2147483648 and 2147483648
- IDEA: How to Add @Data plug-in
- How many pieces of data can list store in Java?
- How to save big data in Oracle to CLOB
- Differences between Java stack overflow ror and outofmemoryerror
- The difference, cause and solution of memory overflow and memory leak
- How to Fix “the data of store is lost after Vue refreshes the page”