C
Programming and Technical
Q. What is automatic type promotion in c?
A. In c if two operands are of different data type in a binary operation then before performing any operation compiler will automatically convert the operand of lower data type to higher data type. This phenomenon is known as automatic type conversion.
For example:
int a=10,c;
float b=5.5f;
c=a+b;
Here a int variable while b is float variable. So before performing addition operation value of the variable a (Lower data type) will automatically convert into float constant (higher data type) then
it will perform addition operation.
Read Solution (Total 0)
C Other Question