/* File: promote.c Testing parameter passing with different types. This program uses BAD programming style. */ #include float add3 (float) ; int main() { int i, n ; double x, y ; printf("i =? ") ; scanf("%d", &i) ; n = add3(i) ; printf("%d + 3 = %d\n", i, n) ; printf("x =? ") ; scanf("%lf", &x) ; y = add3(x) ; printf("%f + 3 = %f\n", x, y) ; return 0 ; } float add3(float z) { return (z + 3.0) ; }