Google News
logo
Explicit Type Conversions In C Language
This means converting a higher data type to lower data type, When we want to convert a type forcibly in a way that is  different from automatic type conversion, we need to go for explicit type conversion.
  Syntax :
(type name) expression;

Type name is one of the standard data type. Expression may be a constant variable or an expression this process of conversion is called as casting a value.

  Example :
float f=12.50;
int i;
i= (int) f;
  Program: The following program is an example of Explicit type casting.
#include <stdio.h>
main()
{
   int sum = 17, count = 5;
   double mean;
   mean = (double) sum / count;
   printf("Value of mean : %f\n", mean );
}
Output :

Value of mean: 3.40000