C Language
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

We see you’re using an ad blocker.

Our website is made possible by displaying ads to our visitors.

Please help us continue to provide you with free. So please disabling your ad blocker.