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.
- Prepare
- C++
- Introduction
- Basic Data Types
- Discussions
Basic Data Types
Basic Data Types
Sort by
recency
|
1520 Discussions
|
Please Login in order to post a comment
You can do it too. Its important that the different type of values and by char must separate it:
code in cpp: use fixed<
for negative sign what to do
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; }
include
int main() { // Declare variables for each data type int i; long l; char ch; float f; double d;
}