Enumeration constants are integer constants, not ordinary modifiable variables. Their values can be compared and used in integer expressions. Enumeration types provide a convenient way to represent related named values such as states, modes, or categories.
Programming in C MCQ - Constants, Variables and Data Types
Let n = 7. It needs actually a 3 bit-field. But log (n + 1) + 1 will be log (8) + 1, i.e., 4, which is wrong.
If n = 8, 4 bits are needed. But, log (n - 1) + 1 will be log (7) + 1, which will have an integral part of 3.
log(n) + 1 will yield the correct result in both the cases.
In C, constants are values that do not change during program execution. Constants may appear directly as integer, floating-point, character, or string literals. Symbolic constants can be introduced using #define, while const-qualified objects provide read-only access through the declared identifier. These mechanisms have different properties.
Implicit type conversion occurs automatically when C evaluates expressions, performs assignments, or passes arguments under applicable conversion rules. Integer promotions and the usual arithmetic conversions determine how operands of different arithmetic types are converted to compatible types.
For a nonnegative floating-point value, the expression (int)(x + 0.5) is a traditional way to round to the nearest integer by adding 0.5 and then truncating the fractional part. This approach is not generally correct for negative values. The standard math library provides round() and lround() for more general rounding.

