summaryrefslogtreecommitdiffstats
path: root/src/chapter1/lesson5/q2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/chapter1/lesson5/q2.cpp')
-rw-r--r--src/chapter1/lesson5/q2.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/chapter1/lesson5/q2.cpp b/src/chapter1/lesson5/q2.cpp
new file mode 100644
index 0000000..236a1be
--- /dev/null
+++ b/src/chapter1/lesson5/q2.cpp
@@ -0,0 +1,17 @@
+#include <iostream>
+
+/* This program will ask user for three numbers, store each in separate
+ * variables x, y, and z respectively and print the message with their values.
+ */
+int main() {
+ std::cout << "Enter three numbers: ";
+
+ int x{};
+ int y{};
+ int z{};
+ std::cin >> x >> y >> z;
+
+ std::cout << "You entered " << x << ", " << y << ", and " << z << ".\n";
+
+ return 0;
+}