Data Type, Data Type Modifier, Format Specifier, Size, Limit, Address - 9

Problem Set 1.3: Data Type, Data Type Modifier, Format Specifier, Size, Limit, Address [9]

  1. Primitive Data Type

    1. Declare one variable for each Primitive Data Type.

      1. Declare an integer variable. (Repeated: Data Type, IO Problem Set 1.1)

      2. Declare a float variable. (Repeated: Data Type, IO Problem Set 1.1)

      3. Declare a double variable. (Repeated: Data Type, IO Problem Set 1.1)

      4. Declare a character variable. (Repeated: Data Type, IO Problem Set 1.1)

    2. [1] Print the Memory Size for each Primitive Data Type in Byte.

      • Print the Memory Size for an integer variable.

      • Print the Memory Size for a float variable.

      • Print the Memory Size for a double variable.

      • Print the Memory Size for a character variable.

    3. [2] Print the Memory Address of one variable for each Primitive Data Type (char, int, float, double) as a local and global variable.

      • Local Variable (Local Variable, Argument, Local Constant Variable, Array, Local Pointer) [Stack Segment]

      • Dynamically Allocated Memory [Data Segment -> Heap]

      • Uninitialized Global Variable (Global Variable, Global Pointer) [Data Segment -> Static Segment -> Uninitialized Data Segment]

      • Uninitialized Local Static Variable [Data Segment -> Static Segment -> Uninitialized Data Segment (BSS Segment)]

      • Initialized Global Variable (Global Variable, Global Pointer, Constant Global Variable) [Data Segment -> Static Segment -> Initialized Data Segment]

      • Initialized Local Static Variable [Data Segment -> Static Segment -> Initialized Data Segment]

    4. [3] Print the Maximum and Minimum Limit for each Primitive Data Type.

      • Print the Maximum Value for an integer variable.

      • Print the Minimum Value for an integer variable.

      • Print the Maximum Value for a float variable.

      • Print the Minimum Value for a float variable.

      • Print the Maximum Value for a double variable.

      • Print the Minimum Value for a double variable.

      • Print the Maximum Value for a character variable.

      • Print the Minimum Value for a character variable.

    5. Input and print a value for each Primitive Data Type.

      1. Input one integer number and print that number. (Repeated: Data Type, IO Problem Set 1.1)

      2. Input one float number and print that number. (Repeated: Data Type, IO Problem Set 1.1)

      3. Input one double number and print that number. (Repeated: Data Type, IO Problem Set 1.1)

      4. Input one character and print that character. (Repeated: Data Type, IO Problem Set 1.1)

  2. Primitive Data Type including Modifiers

    1. [4] Declare one variable for each Primitive Data Type including Modifiers.

    2. [5] Print the Memory Size for each Primitive Data Type in Bytes including Modifiers.

    3. [6] Print the Memory Address of one variable for each Primitive Data Type including Modifiers as a local and global variable.

    4. [7] Print the Maximum and Minimum Limit for each Primitive Data Type including Modifiers.

    5. [8] Assign or Initialize value for each Primitive Data Type including Modifiers.

    6. [9] Input and print a value for each Primitive Data Type including Modifiers.

Data Type, Data Type Modifier

  • List all primitive data type names, keywords, size, and format specifiers.

    1. Integer Number (int)

    2. Single Precision Floating Point Number (float)

    3. Double Precision Floating Point Number (double )

    4. Character (char)

    5. Void (void)

  • List all primitive data type names including modifiers, keywords, size, and format specifiers. (Total 30 Keywords)

      • void

      • int

      • signed

      • signed int

      • unsigned

      • unsigned int

      • short

      • short int

      • signed short

      • signed short int

      • unsigned short

      • unsigned short int

      • long

      • long int

      • signed long

      • signed long int

      • unsigned long

      • unsigned long int

      • long long

      • long long int

      • signed long long

      • signed long long int

      • unsigned long long

      • unsigned long long int

      • float

      • double

      • long double

      • char

      • unsigned char

      • signed char

Last updated