C examples for Data Type:Type Cast
Cast data type vs not casting
#include <stdio.h> int main( void ) { int i1 = 100, i2 = 40; float f1;/* w w w.jav a 2s . c o m*/ f1 = i1/i2; printf("%lf\n", f1); f1 = (float)i1/i2; printf("%lf\n", f1); f1 = (float)i2 + i1/i2; printf("%lf\n", f1); return 0; }