C – Type Casting functions

Prev     Next C Type Casting functions: Typecasting concept in C language is used to modify a variable from one date type to another data type. New data type should be mentioned before the variable name or value in brackets which to be typecast. C type casting functions example program: In the below C program, 7/5 alone will produce integer value as 1. So, type cast is done before division to retain float value (1.4). Output: 1.400000 Note: It is best practice to convert lower data type to higher data type to avoid data loss. Data will be truncated when … Continue reading C – Type Casting functions