1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #include <stdio.h> int main(void) { int i; double f; f = 5 / 4; printf("(5 / 4) = %f\n", f); f = (double)5 / 4; printf("(double)5 / 4 = %f\n", f); i = 1.3 + 1.8; printf("1.3 + 1.8 = %d\n", i); i = (int)1.3 + (int)1.8; printf("(int)1.3 + (int)1.8 = %d\n", i); return 0; } | cs |