printf ("sizeof (int) is %d bytes", (int)sizeof (int));
Most likely it will be 2 or 4.
data-type
Type 'int'
Data-type (short for integer).
The int is a data type in c, c++ or java, It can divided in to two parts that is short and long. Int short if of same size as int (2).
Because that is how the language is defined. It has floating data types and integral data types.
This groups includes byte,short,int and long.Integer data type is used for storing integer values.The size of the int is 32 bit.The range of the int is -2,147,483,648 to 2,147,483,648
Unsigned int does not have a sign, meaning that it can be zero or a positive number in the range of data type (int). Signed data has a sign and can be positive, zero or negative.
the type of data which we store in a variable.. example: int a=10; /*here a is variable (data) which is of type int and stores a value 10.*/
A primitive data type is built into the language - int, char, long, etc. A non-primitive data type is am abstract data type that is built out of primitive data types - linked list, queue, stack, etc.
Data Type : - It is used to identify the type of data. 'C' Language has a large no of data type, Thus it is also known by rich data type language: Data type are generally classified in three group: 1: Fundamental data type 2 Derived Data Type : 3 Use defined data type; 1 Fundamental data type: Fundamental data type includes i) The int data type: The data type int can store integer value only for eg. 14, 45, 78 declaration: int a,b; here we can store any value in variable a & b. ii) Char Data Type : The data type char can store character value only which is enclosed with single quote for e.g. 'c' declaration : char x = 'c' iii) Float Data Type:
The people who create the language take the liberty of deciding the size of data types in a programming lanauage.If you (as a programmer) create your own custom data type, for example by defining a class, then you decide what goes into it - for example, in Java, if one of the pieces of data requires an integer, you have the choice of storing it as an int, which uses 4 bytes, or as a long, which uses 8 bytes (and permits larger numbers).
like this: sizeof(int); replace int with the kind of data you want to find the size of. of course, to be able to do anything with this size data, you'll have to store it into a variable or display it or something.