c int max code example

Example 1: java max int value

public class Test
{
   public static void main(String[] args)
   {
     System.out.println(Integer.MIN_VALUE);
     System.out.println(Integer.MAX_VALUE);
     System.out.println(Integer.MIN_VALUE - 1);
     System.out.println(Integer.MAX_VALUE + 1);
   }
}

Example 2: integer max value representation java

Integer.MAX_VALUE

Example 3: int max in c++

2147483647
  unsigned long long int = 18 446 744 073 709 551 615

Example 4: C largest unsigned int

The sizeof function will help you here.
  sizeof(data type) returns a size_t //Number of bytes whatever the input for sizeof takes

Example:
//This statement will return 2 or 4 (depending on your system)
  return sizeof(int)

Tags: