You are viewing a single comment's thread. Return to all comments →
You should test scanf return to ensure correct data was input.
int a, ret; long b; long long c; char d; float e; double f; ret = scanf("%d %ld %lld %c %f %lf", &a, &b, &c, &d, &e, &f); if(ret == 6) printf("%d\n%ld\n%lld\n%c\n%f\n%lf", a, b, c, d, e, f); else printf("Wrong input.\n"); return 0;
Basic Data Types
You are viewing a single comment's thread. Return to all comments →
You should test scanf return to ensure correct data was input.