Reputation: 93
Consider this example:
float a;
double b;
scanf("%f%f", &a, &b); // A
scanf("%Lf%Lf", &a, &b); // B
scanf("%f%Lf", &a, &b); // C
scanf("%f%lf", &a, &b); // D
Upvotes: 3
Views: 38520
Reputation: 2357
You can use
scanf("%f %lf", &a, &b);
Source: http://www.cplusplus.com/reference/clibrary/cstdio/scanf/
Upvotes: 14