Because your second version explicitly includes the spaces which separate your values, your first doesn't, so it gets out of sync.
Try this:
int a;
long b;
char c;
float d;
double e;
scanf("%d ", &a);
scanf("%ld ", &b);
scanf("%c ", &c);
scanf("%f ", &d);
scanf("%lf", &e);
printf("%d\n", a);
printf("%ld\n", b);
printf("%c\n", c);
printf("%f\n", d);
printf("%lf\n", e);