From 2d74950cf107daa391dba6f483a390e57c60dd0b Mon Sep 17 00:00:00 2001 From: s1n Date: Wed, 27 Nov 2019 22:57:39 -0800 Subject: Add files via upload --- cpp-adding/README.md | 59 +++++++++++++++++++++++++++++++++++++++++++++++++ cpp-adding/src/main.cpp | 30 +++++++++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 cpp-adding/README.md create mode 100644 cpp-adding/src/main.cpp (limited to 'cpp-adding') diff --git a/cpp-adding/README.md b/cpp-adding/README.md new file mode 100644 index 0000000..d9551de --- /dev/null +++ b/cpp-adding/README.md @@ -0,0 +1,59 @@ +``` + ___ _ _ _ + / _ \ | | | (_) +/ /_\ \ __| | __| |_ _ __ __ _ +| _ |/ _` |/ _` | | '_ \ / _` | +| | | | (_| | (_| | | | | | (_| | +\_| |_/\__,_|\__,_|_|_| |_|\__, | + __/ | + |___/ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +``` + + +## About The Project + +Adding in C++. + + + + +## Getting Started + +[Clone or download](https://github.com/8cy/cpp-adding) the project and run in your favourite choice of [IDE](https://en.wikipedia.org/wiki/IDE) or [Text Editor](https://en.wikipedia.org/wiki/Text_editor) with a Code Runner. + +> *[Code Runner](https://marketplace.visualstudio.com/items?itemName=formulahendry.code-runner) by [Jun Han](https://marketplace.visualstudio.com/publishers/formulahendry) on the [VSCode Marketplace](https://marketplace.visualstudio.com/) is my Code Runner of choice but you can feel free to use anything that works for you.* + +### Prerequisites + +This is an example of how to list things you need to use the software and how to install them. +* Your favourite C++ Compiler + + + + +## Contributing + +Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**. + +1. Fork the Project +2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`) +3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`) +4. Push to the Branch (`git push origin feature/AmazingFeature`) +5. Open a Pull Request + + + + +## License + +Distributed under the MIT License. See [`LICENSE`](/LICENSE) for more information. + + + + +## Contact + +s1nical - [@s1nical](https://twitter.com/s1nical) - bis@s1n.pw + +Project Link: [https://github.com/8cy/cpp-adding](https://github.com/8cy/cpp-adding) diff --git a/cpp-adding/src/main.cpp b/cpp-adding/src/main.cpp new file mode 100644 index 0000000..6051ef1 --- /dev/null +++ b/cpp-adding/src/main.cpp @@ -0,0 +1,30 @@ +// TODO: firstNumber and secondNumber are entered on two different lines, then calculated into sumOfTwoNumbers. + +#include +#include // For restart function +using namespace std; + +// If you really wanted to you could put all of the logic into main(), but I just like to keep it like this so it looks nice and tidy. +int Logic() +{ + int firstNumber, secondNumber, sumOfTwoNumbers; + + cout << "Enter two numbers: "; + cin >> firstNumber >> secondNumber; + + // Temp. variable storage + sumOfTwoNumbers = firstNumber + secondNumber; + + // Prints sumOfTwoNumbers + cout << firstNumber << " + " << secondNumber << " = " << sumOfTwoNumbers << endl; + + return 0; +}; + +int main() +{ + Logic(); + system("pause"); + + return 0; +} -- cgit v1.2.3