You are viewing a single comment's thread. Return to all comments →
int main() { // Declare variables for each data type int i; long l; char ch; float f; double d;
// Read input values scanf("%d %ld %c %f %lf", &i, &l, &ch, &f, &d); // Print each value on a new line printf("%d\n", i); // Print int printf("%ld\n", l); // Print long printf("%c\n", ch); // Print char printf("%.3f\n", f); // Print float with 3 decimal places printf("%.9lf\n", d); // Print double with 9 decimal places return 0;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Basic Data Types
You are viewing a single comment's thread. Return to all comments →
include
int main() { // Declare variables for each data type int i; long l; char ch; float f; double d;
}