logo
Implicit Type conversion In C language
In this the data type /Variable of lower type (which holds lower range of values or has lower precision) is converted to a higher type (which holds higher range of values or has high precision). This type of conversion is also called “promotion”.  

 If a “char” is converted into “int” it is called as internal promotion.
  Example :
int i;
char c;
c=’A’;
i=c;

Now the int variable i hold the ASCII code of the char “A”.

  Program : The following program is an example of Implicit type casting.
#include <stdio.h>
main()
{
   int  i = 17;
   char c = 'c'; /* ascii value is 99 */
   int sum;
   sum = i + c;
   printf(“Value of sum : %d\n”, sum );
}
Output :

Value of sum= 116