From 28732f386f8982e18bb8a44573967692fcd0903e Mon Sep 17 00:00:00 2001 From: oerivas-star Date: Wed, 11 Feb 2026 11:49:05 -0800 Subject: [PATCH 1/4] adding the yml file --- .github/workflows/actions.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/actions.yml diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml new file mode 100644 index 00000000..b5bf693b --- /dev/null +++ b/.github/workflows/actions.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: g++ -std=c++17 main.cpp From fff50871b47f174d8f6f9dd1d13f234f8512afbc Mon Sep 17 00:00:00 2001 From: oerivas-star Date: Wed, 11 Feb 2026 12:26:09 -0800 Subject: [PATCH 2/4] Create README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 00000000..b0ae3f27 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +HELLO +my name is Omar nice to meet all From 768d91cb1e3955d46cd1346915e8397d499ff872 Mon Sep 17 00:00:00 2001 From: oerivas-star Date: Wed, 11 Feb 2026 12:26:38 -0800 Subject: [PATCH 3/4] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index b0ae3f27..2bc7ccd2 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ +[![Build C++](https://github.com/oerivas-star/MyFirstExample/actions/workflows/actions.yml/badge.svg)](https://github.com/oerivas-star/MyFirstExample/actions/workflows/actions.yml) + HELLO my name is Omar nice to meet all From 70f799c01f3ac123bd1721aa7a7187831775bce4 Mon Sep 17 00:00:00 2001 From: oerivas-star Date: Wed, 18 Feb 2026 09:21:07 -0800 Subject: [PATCH 4/4] Handeling division by 0 --- main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.cpp b/main.cpp index 5411e7a3..7f7c18e4 100644 --- a/main.cpp +++ b/main.cpp @@ -16,6 +16,10 @@ int main() cout << "Addition: " << x + y << endl; cout << "Subtraction: " << x - y << endl; cout << "Multiplication: " << x * y << endl; + if (y == 0){ + cout << "Cannot divide by 0" << endl; + return 1; + } cout << "Division: " << x / y << endl; cout << "Remainder: " << x % y << endl; cout << "Square Root: " << sqrt(x) << endl;