C++ examples for Data Type:float
Demonstrate mixed data type in an expression, mix int and float type value
#include <stdio.h> int main()/* w w w.j ava2 s .c o m*/ { int bonus=50; float salary=1400.50; float total; total=salary+bonus; // bonus becomes floating-point // but only temporarily. printf("The total is %.2f", total); return 0; }