/* Copyright (c) 2001-2004 by SoftIntegration, Inc. All Rights Reserved */
/* this program scanf.c is executed by command
       scanf.c < scanf.in
   Input file scanf.in contains the following data
       1.0 2.0 3.0 4.0 
*/
#include <stdio.h>
 
int main() {
    float f;
    double d;
 
    printf("input f\n");
    scanf("%f",&f);
    printf("Your input of f is %f\n", f);
    printf("input d\n");
    scanf("%lf",&d);
    printf("Your input of d is %f\n", d);
    printf("input f\n");
    scanf("%lf",&f); /* ERROR: should use %f for float */
    printf("Your input of d is not what you typed in f = %f\n", f);
    printf("input d\n");
    scanf("%f",&d); /* ERROR: should use %lf for double */
    printf("Your input of d is not what you typed in d = %f\n", d);
}

