limit of int in c++ code example
Example 1: how to change double to int in java
class Scratch{
public static void main(String[] args){
double decimal = 5.7;
System.out.println( (int) decimal );
System.out.println( Math.round(decimal * 10) / (double) 10);
System.out.println( decimal % 1);
System.out.println( Integer.parseInt( String.valueOf(decimal).substring(0, String.valueOf(decimal).indexOf("."))));
}
}
Example 2: maximum int c++
#include <limits>
int imin = std::numeric_limits<int>::min();
int imax = std::numeric_limits<int>::max();
Example 3: int max in c++
2147483647
unsigned long long int = 18 446 744 073 709 551 615
Example 4: multiplication of string with int in python
#multiplying string with a integer
"superman " * 5
# It will return a new string