diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..31a571a --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,23 @@ +name: Build C++ + +on: + push: + branches: "**" + pull_request: + branches: [ main ] + +jobs: + install: + runs-on: ubuntu-latest + steps: + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y -f build-essential g++ cmake + build: + needs: install + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build project + run: ls diff --git a/README.md b/README.md new file mode 100644 index 0000000..cbbacf4 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +[![Build C++](https://github.com/ChicoState/FirstIO/actions/workflows/actions.yml/badge.svg)](https://github.com/BogachanKarabiyik/MyFirstExample/actions/workflows/actions.yml) diff --git a/main.cpp b/main.cpp index a495fc9..cd96926 100644 --- a/main.cpp +++ b/main.cpp @@ -3,7 +3,7 @@ int main() { - std::cout << "THE FIRST EXAMPLE MATH DISPLAY!\n"; + std::cout << "THE FIRST EXAMPLE MATH DISLAY!\n"; std::cout << "Hi, please enter two whole numbers: "; int x,y; @@ -12,7 +12,8 @@ int main() std::cout << "Addition: " << x + y << std::endl; std::cout << "Subtraction: " << x - y << std::endl; std::cout << "Multiplication: " << x * y << std::endl; - std::cout << "Division: " << x / y << std::endl; + if (y != 0) + std::cout << "Division: " << x / y << std::endl; std::cout << "Remainder: " << x % y << std::endl; std::cout << "Square Root: " << sqrt(x) << std::endl; std::cout << "Square: " << pow(x, y) << std::endl;