Mega Code Archive

 
Categories / C Tutorial / Data Type
 

Forced conversion

Forced conversion occurs when you are converting the value of the larger data type to the value of the smaller data type When floating points are converted to integers, truncation occurs. #include <stdio.h> main() {     double f1 = 12.23456;     printf("%d \n", (int)f1); } 12