We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
// 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;
}
Cookie support is required to access HackerRank
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 →
https://trafficridermod.com.in/
nt 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; }