diff options
Diffstat (limited to '4a/5.4.1Exercises/5.4.1Exercises.cpp')
| -rw-r--r-- | 4a/5.4.1Exercises/5.4.1Exercises.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/4a/5.4.1Exercises/5.4.1Exercises.cpp b/4a/5.4.1Exercises/5.4.1Exercises.cpp new file mode 100644 index 0000000..fd837c6 --- /dev/null +++ b/4a/5.4.1Exercises/5.4.1Exercises.cpp @@ -0,0 +1,18 @@ +// 5.4.1Exercises.cpp : This file contains the 'main' function. Program execution begins and ends there. +// + +#include <iostream> +using namespace std; + +int main() +{ + float temp = 0.0f; + int precision = 1; + cout << "What is your temprature: "; + cin >> temp; + + cout.width(6); + cout.precision(1); + + cout << fixed << temp; +} |