Difficulty: Easy
Correct Answer: 1, 2, 3 only
Explanation:
Introduction / Context:This question checks foundational C knowledge: basic data types (int, float), operators (*, +), and numeric literal classification (integer vs real/floating constants).
Given Data / Assumptions:
Concept / Approach:Map each statement against C rules: types from declarations, operator categories, and literal kinds. A number with a decimal point is a floating (real) constant, not an integer constant.
Step-by-Step Solution:
Check (1): 'int ram;' → ram has type int → statement (1) is true.Check (2): 'float alpha, gamma;' → both are float (real) → statement (2) is true.Check (3): In C, * and + are arithmetic operators (multiplication and addition) → statement (3) is true.Check (4): The literal 0.562 includes a decimal point → it is a floating (real) constant, not an integer constant → statement (4) is false.Verification / Alternative check:Compiler perspective: '0.562' tokenizes as a floating literal; integer constants have no decimal point and optional suffixes. Therefore, (4) cannot be true in C.
Why Other Options Are Wrong:
Common Pitfalls:
Final Answer:1, 2, 3 only
Discussion & Comments