You are viewing a single comment's thread. Return to all comments →
using namespace std;
int main() { int integer; long longValue; char character; float floatingPoint; double doubleValue;
// Input reading cin >> integer >> longValue >> character >> floatingPoint >> doubleValue; // Output with proper formatting cout << integer << endl; cout << longValue << endl; cout << character << endl; cout << fixed << setprecision(3) << floatingPoint << endl; // Set float precision to 3 decimal places cout << fixed << setprecision(9) << doubleValue << endl; // Set double precision to 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
include // Include for setting precision
using namespace std;
int main() { int integer; long longValue; char character; float floatingPoint; double doubleValue;
}